What is the difference between split() and explode()?

后端 未结 6 1667
一生所求
一生所求 2020-12-29 02:06

The PHP manual for split() says

This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly dis

6条回答
  •  孤城傲影
    2020-12-29 02:56

    In split() you can use regular expressions to split a string. Whereas explode() splits a string with a string. preg_split is a much faster alternative, should you need regular expressions.

提交回复
热议问题