June 25th, 1999, 06:16 AM
I'm very new to PHP3 and just started learning three days ago. I have seen on a PHP3 tutorial that with a special command data divided by space could be splitted into an array or several variables (for picking out the words of a sentence). I just couldn't find it so far. Can anyone help me?
Thanks in advance.
June 25th, 1999, 05:05 PM
Check out the explode() function. It takes a string and chops it up into an array, splitting elements up by a delimiter that you provide.
$data = "This is a test";
$sentence = explode(" ", $data);
$sentence would now have 4 elements (0 - 3), each of which contains one of the words from the data.