• PHP Video Tutorials

PHP - Function Strtok



Syntax

strtok(string,split)

Definition and Usage

It is a tokenize string

Return Values

It returns a string token

Parameters

Sr.No Parameters & Description
1

string

It specifies the string to split

2

split

It specifies one or more split characters

Example

Try out the following example

<?php
   $input = "tutorials point simple easy learning.";
   $token = strtok($input, " ");
   
   while ($token !== false){
      echo "$token<br>";
      $token = strtok(" ");
   }
?>

This will produce following result −

tutorials
point
simple
easy
learning.
php_function_reference.htm
Advertisements