![]() |
Any idea what Deprecated: Function split() is deprecated in means
im getting error
Deprecated: Function split() is deprecated in in this code <?php $fcontents = join ('', file ($_SERVER['DOCUMENT_ROOT'] . '/banners/banners_468_60.txt')); $s_con = split("~",$fcontents); $banner_no = rand(0,(count($s_con)-1)); echo $s_con[$banner_no]; ?> |
The function split() was deprecated as of PHP 5.3.0 .. its use is not suggested.
|
Quote:
|
Sorry, I didn't look who posted this, I know you'll need a bit more handholding:
Your PHP is configured with E_DEPRECATED, which shows warnings for functions that are suggested to no longer be used. This isn't an appropriate setting for a production server, and whoever configured your site/server didn't do it correctly .. a production server bitching about coding standards isn't ideal. If you don't need regular expressions in your split (which it looks like you don't), use explode(). If you do need them, use preg_split(). I'd go with explode() in this case. |
Don't use that function. If it is depreciated now it is only a matter of time before it is removed from php and will not exist.
|
Interestingly, join() isn't common usage. implode() is more common, at least for me, which implies that it is the opposite of explode(), versus the opposite of split() -- which it is NOT.
join() is just an alias for implode() .. so if you use implode(), it's more clear to use explode() to take it apart. |
Quote:
|
Quote:
|
Quote:
|
Quote:
:thumbsup |
Quote:
|
Quote:
|
All times are GMT -7. The time now is 04:16 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123