Jump to content

split() and join() functions


jaArch

Recommended Posts

Yep, both split() and explode() did the same thing, so they dropped split(), same for join() and implode().

 

Not entirely true.  When join() was introduced in PHP 3.0b5 (a very long time ago) it was immediately an "alias" for implode(), which means that it does exactly (literally!) the same thing. 

 

However, split() and explode() are different functions entirely. split() uses a POSIX regular expression to break a string into pieces (sometimes the regular expression is a string of literal characters). explode() does not use regular expressions, it just splits of the characters given. So, there is some overlap in what split() and explode() can do but they're not the same at all.

 

split() was deprecated as part of the wider deprecation of all of the POSIX regex functions in PHP 5.3.0.  None of the other three functions (explode(), join(), implode()) are deprecated.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.