<!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
strtok.php
转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
strtok函数应用
using nam
#include ios c++ -
strtok函数的用法
strtok函数的基本用法
字符串 #include 分隔符 -
strtok和strtok_r
strtok和strtok_r原型:char *strtok(char *s, char *delim);功能:分解字符串为一组字符串。s为要分解的字符串,deli
字符串 #include 分隔符 执行过程 #define