galvin Posted January 13, 2011 Share Posted January 13, 2011 If I was pulling back data from MySQL that was like this "monkeys / dogs / cats", how would I grab just "monkeys" from that using PHP? In other words, I want to grab all text until a "/" is seen. Quote Link to comment Share on other sites More sharing options...
Garethp Posted January 13, 2011 Share Posted January 13, 2011 $array = explode("/", $data); $monkey = $array[0]; http://php.net/manual/en/function.explode.php Quote Link to comment Share on other sites More sharing options...
galvin Posted January 13, 2011 Author Share Posted January 13, 2011 Beautiful thanks! Quote Link to comment 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.