Xtremer360 Posted June 18, 2010 Share Posted June 18, 2010 I keep getting a Deprecated: Function split() is deprecated on line.... Can someone explain this? function convertdate($date) { list ($year, $month, $day) = split ('-', $date); $date=trim($month)."-".trim($day)."-".trim($year); return $date; } Quote Link to comment https://forums.phpfreaks.com/topic/205212-function-split-is-deprecated/ Share on other sites More sharing options...
Alex Posted June 18, 2010 Share Posted June 18, 2010 You should use preg_split to split a string by a regular expression. But in that case I don't see why you can't use explode, you're not even using a regular expression. Quote Link to comment https://forums.phpfreaks.com/topic/205212-function-split-is-deprecated/#findComment-1074161 Share on other sites More sharing options...
siwelis Posted June 18, 2010 Share Posted June 18, 2010 What version of PHP are you using? <? phpinfo(); ?> That function has been depreciated and may no longer be supported: http://php.net/manual/en/function.split.php You need to figure out how to accomplish what "split ('-', $date)" would do using either preg_split or explode... I'm not familiar with them enough myself to help you in a timely manner, but you will be on the right path. Quote Link to comment https://forums.phpfreaks.com/topic/205212-function-split-is-deprecated/#findComment-1074163 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.