<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
  <head>
   <title> strtok.php </title>
   <meta charset="UTF-8">
   <meta name="Author" content="">
   <meta name="Keywords" content="">
   <meta name="Description" content="">
  </head> <body>
 <?php
 $string = "This is\tan example\nstring";
 /* 使用tab 和换行符号作为分隔符 */
 $tok = strtok($string, " \n\t");
 while ($tok) {
 echo "Word=$tok<br />";
 $tok = strtok(" \n\t");
 }
 ?>
  </body>
 </html>
Word=This
 Word=is
 Word=an
 Word=example
 Word=string