<?php |
echo strlen ( 'abc def' ); //输出 7 |
echo strlen ( 'ab北京' ); //输出 6 ,UTF-8编码下输出 8 |
?> |
<?php |
$str = "This function returns the last occurance of a string" ; |
$pos = strrpos ( $str , "st" ); |
if ( $pos !== FALSE){ |
echo '字串 st 最后出现的位置是:' , $pos ; |
} else { |
echo '查找的字符串中没有 in 字串' ; |
} |
?> |