strtok.php : strtok « String « PHP






strtok.php

 
<?php
   $info = "this:is|a,test.";

   $tokens = ":|,";
   $tokenized = strtok($info, $tokens);
   while ($tokenized) {
      echo "Element = $tokenized<br>"; 
      $tokenized = strtok($tokens); 
   }
?>
  
  








Related examples in the same category

1.strtok() function performs a similar task to explode()
2.strtok() function tokenizes string, using the characters specified in tokens.
3.Dividing a String into Tokens with strtok()