PHP strtok() function is utilized to split a string into smaller strings(tokens).
Syntax:
strtok(string,split)
string : Required. Specifies the string to split
split : Required. Specifies the string characters token delimiters.
Example:
<?php
$str_name = "Good morning. Have a nice day.";
$token_name = strtok($str_name," ");
while($token_name != false){
echo "$token_name <br />";
$token_name = strtok(" ");
}
?>
Output will be:
Good
morning.
Have
a
nice
day.
*****************************************************************
PHP...