常用字符串函数(二)_PHP
程序员文章站
2022-06-10 23:06:06
...
$text = "My dog's name is Angus.";
//print Angus
print(substr($text, 17, 5)."
");//取出子串
?>
//切开字串
// create a demo string
$line = "leon\tatkinson\tleon@clearink.com";
// loop while there are still tokens
for($token = strtok($line, "\t");
$token != "";
$token = strtok("\t"))
{
print("token: $token
\n");
}
?>
//传回字串中某字串开始处至结束的字串
$text = "Although this is string, it's not very long.";
print("
".strstr($text, ","));
?>
上一篇: 网站后台管理的密码忘了如何找回
下一篇: php生成圆角图片代码