strtok() function performs a similar task to explode() : strtok « String « PHP






strtok() function performs a similar task to explode()

 
<?php 
$anemail = "l@b.ca"; 
$thetoken = strtok ($anemail, "@"); 
while ($thetoken){ 
    echo $thetoken . "<br />"; 
    $thetoken = strtok ("@"); 
} 
?>
  
  








Related examples in the same category

1.strtok() function tokenizes string, using the characters specified in tokens.
2.strtok.php
3.Dividing a String into Tokens with strtok()