PHP strtok() Function

PHP strtok() Function

The strtok() function in PHP splits a string into smaller strings or tokenize the specified string. 

Syntax

Parameter

str(required)- This parameter represents the input string to split into smaller strings or tokens.

token(required)- It signifies the delimiter which is used in splitting up the str parameter.

Return

This function returns a string token.

Example 1

Output

Example 2

Output

Example 3

Output