php 字符串

    xiaoxiao2021-03-25  95

    php中字符串之间通过.来连接

    $text1="hello"; $text2="world"; echo $text1.",".$text2; strlen函数:返回字符串的长度

    echo strlen("hello");

    strpos()函数:在字符串内查找一个字符或者字符串的起始位置

    $text1="hello,world"; $text2="world"; echo strpos($text1,$text2); 结果返回6,字符串下标从0开始

    strpos(字符串,需要查找的字符);

    转载请注明原文地址: https://ju.6miu.com/read-22245.html

    最新回复(0)