This is the the code:
<?php
$string = 'Hey there buddy';
$token = strtok($string, ' ');
while($token !== false)
{
echo $token."<br/>";
$token = strtok(' ');
}
?>
I just want to know if I understand this right. Here is what I think about strtok(). To use strtok(), first, you have to set it to a variable($token in this case) with input string ($string in this case) and a separator (' ' in this case). And then you have to use it again in a while loop but this time only specify a separator not the input string because it's already connected to variable $string at the time we first used it. Am I right?