helloise Posted June 10, 2011 Share Posted June 10, 2011 this does not seem to work: $user = $_SESSION['id']; print_r(preg_split("/",$user); can some one help please thanks Quote Link to comment https://forums.phpfreaks.com/topic/238942-splitting-a-string-on-with-preg_split-in-php-does-not-seem-to-work/ Share on other sites More sharing options...
derwert Posted June 10, 2011 Share Posted June 10, 2011 please explain what you are trying to accomplish, your pattern is not a valid pregex pattern. If you are trying to split a string by the forward slash then use explode() instead. i.e. $user = $_SESSION['id']; print_r(explode('/' , $user)); Quote Link to comment https://forums.phpfreaks.com/topic/238942-splitting-a-string-on-with-preg_split-in-php-does-not-seem-to-work/#findComment-1227807 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.