首页 > Web开发 > 详细

025-PHP常用字符串函数(二)

时间:2019-06-07 13:25:14      阅读:72      评论:0      收藏:0      [点我收藏+]
<?php
    $text = "My dog‘s name is Angus.";
    //print Angus
    print(substr($text, 17, 5)."<hr>");//取出子串

    //切开字串
    // 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<BR>\n");
    }

    //传回字串中某字串开始处至结束的字串
    $text = "Although this is string, it‘s not very long.";
    print("<hr>".strstr($text, ",")); 
?>

技术分享图片

 

025-PHP常用字符串函数(二)

原文:https://www.cnblogs.com/tianpan2019/p/10987991.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!