strtok.php

来源:互联网 发布:淘宝视频制作软件 编辑:程序博客网 时间:2024/06/18 12:07

<!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

0 0
原创粉丝点击