strtok

PHP 4, PHP 5, PHP 7, PHP 8
strtok - Tokenize string

strtok( string$string, string$token ): string|false

Alternative signature (not supported with named arguments):

stringfalsestrtok stringtoken

Parameters

string

The string being split up into smaller strings (tokens).

token

The delimiter used when splitting up string.

Return Values

A string token, or false if no more tokens are available.

Notes

Warning:

This function may return Boolean false, but may also return a non-Boolean value which evaluates to false. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.

Related Functions

Example of strtok

Show all examples for strtok

PHP Version:


Function strtok:

Strings Functions

Most used PHP functions