Deprecated: Function split() Help Please

Associate
Joined
3 Jun 2004
Posts
557
Location
Bristol
Hello,

Hopefully someone may be able to help with this.

I have just updated my VPS to PHP version 5.3.2 and now I see an error in my admin panel because the version has deprecated the function split().


The error I see is below.

Deprecated: Function split() is deprecated in /inc/classes/db.php on line 20


I have opened the db.php page and have looked at line 20 but have no idea what should be changed. I looked on the net and found references to replacements "explode" and "preg_split" but have no idea if this is what I need and where anything should be entered.


Below is what line 20 shows.

$this->queryArray = $dosplit ? split('\?', $queryStr) : array($queryStr);

If someone can please let me know what needs changing it will be very much appreciated.


Thanks
Dan
 
try changing the word split to explode - think they should interchange without a problem.

edit: actually, think this should be good to go:

Code:
$this->queryArray = $dosplit ? explode("\?", $queryStr) : array($queryStr);

Not a PHP expert though - could be wrong :)
 
Last edited:
Try this:

PHP:
$this->queryArray = $dosplit ? explode('?', $queryStr) : array($queryStr);

explode doesn't need the ? to be escaped.
 
Back
Top Bottom