what is the syntax of the STRTOK() function in php?
strtok(string,split)
Parameter | Description |
---|---|
string | Required. Specifies the string to split |
split | Required. Specifies one or more split characters |
examples of the STRTOK() function
Example 1. In this example, we split string one by one.
<?php
$string = "Hello world. Beautiful day today.";
$token = strtok($string, " ");
while ($token !== false)
{
echo "$token<br>";
$token = strtok(" ");
}
?>