Jump to content

Archived

This topic is now archived and is closed to further replies.

EchoFool

split() is deprecated

Recommended Posts

I keep getting this error all of a sudden for my split function

Deprecated: Function split() is deprecated

 

What does that mean, that split() is no longer the function to use ?

Share this post


Link to post
Share on other sites

It means exactly what it says.. Check the manual: split()

 

It is indeed depreciated as of PHP 5.3.0, meaning it'll throw an E_DEPRECATED notice. You could still use it, but it'll be removed and not supported so it's best to find another method.

Share this post


Link to post
Share on other sites

Either you or your host upgraded to PHP 5.3

 

The manual entry for split says:

Note: As of PHP 5.3.0 the regex extension is deprecated, calling this function will issue an E_DEPRECATED notice.

 

Read the rest of the entry for suggestions.

 

Ken

Share this post


Link to post
Share on other sites

If you have a delimiter you can (and should use explode).

 

 

If you have a regular expression pattern, you should use preg_split.

Share this post


Link to post
Share on other sites

In php coding or PHP script whenever you get "split () is depricated" then just replace  "split" with "explode". Because the new version of MYSQL accept explode instead of split.

Share this post


Link to post
Share on other sites

In php coding or PHP script whenever you get "split () is depricated" then just replace  "split" with "explode".

Wrong. split() and explode() are similar but not compatible.

 

Because the new version of MYSQL accept explode instead of split.

Wrong. I'm even not sure what you're trying to say but it sounds wrong.

 

And apparently you didn't notice that this thread is three years old. There isn't anything left to say beyond what's already been said so there really isn't any reason to bump it.

Share this post


Link to post
Share on other sites

×
×
  • 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.