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

后端 未结 6 1705
一生所求
一生所求 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:42

    Both are used to split a string into an array, but the difference is that split() uses pattern for splitting whereas explode() uses string. explode() is faster than split() because it doesn't match string based on regular expression.

提交回复
热议问题