PHP strtok() Function

P
PHP strstr() Function
PHP strtolower() Function

what is the syntax of the STRTOK() function in php?

strtok(string,split)
ParameterDescription
stringRequired. Specifies the string to split
splitRequired. Specifies one or more split characters
PHP STRTOK() method

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(" ");
}
?>
PHP strstr() Function
PHP strtolower() Function

Add comment

Tutor Network

Share this

Learn PHP from A to Z