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 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)); 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
Archived
This topic is now archived and is closed to further replies.