GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Any idea what Deprecated: Function split() is deprecated in means (https://gfy.com/showthread.php?t=1107517)

AllAboutCams 04-24-2013 08:06 AM

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];
?>

edgeprod 04-24-2013 08:08 AM

The function split() was deprecated as of PHP 5.3.0 .. its use is not suggested.

AllAboutCams 04-24-2013 08:11 AM

Quote:

Originally Posted by edgeprod (Post 19595020)
The function split() was deprecated as of PHP 5.3.0 .. its use is not suggested.

Great does that mean i need someone to rewrite the code

edgeprod 04-24-2013 08:11 AM

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.

notjoe 04-24-2013 08:13 AM

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.

edgeprod 04-24-2013 08:13 AM

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.

AllAboutCams 04-24-2013 08:19 AM

Quote:

Originally Posted by edgeprod (Post 19595026)
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.

Thank you explode worked great

edgeprod 04-24-2013 08:20 AM

Quote:

Originally Posted by AllAboutCams (Post 19595053)
Thank you explode worked great

Sure. Bitcoin tips accepted.

AllAboutCams 04-24-2013 08:27 AM

Quote:

Originally Posted by edgeprod (Post 19595057)
Sure. Bitcoin tips accepted.

send me your bitcoin/litecoin address

edgeprod 04-24-2013 08:32 AM

Quote:

Originally Posted by AllAboutCams (Post 19595076)
send me your bitcoin/litecoin address

Primary tipping address is: 1BLgmNjaQadASUADbTYGJKvmtqX9iniHqn

:thumbsup

AllAboutCams 04-24-2013 09:27 AM

Quote:

Originally Posted by edgeprod (Post 19595083)
Primary tipping address is: 1BLgmNjaQadASUADbTYGJKvmtqX9iniHqn

:thumbsup

Sent what i had left in btc-e thanks a lot for the help

edgeprod 04-24-2013 10:05 AM

Quote:

Originally Posted by AllAboutCams (Post 19595198)
Sent what i had left in btc-e thanks a lot for the help

Appreciated, and you're welcome. :thumbsup


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