<?php 得到PHP中最后一个字符 $str = " www.wdphp.com "; $var = trim($str); len = $strlen($var)-1; echo $var{$len};
方法2:
<?php
$str = "www.wdphp.com";
echo substr($str, -1);
相关博文
php 截取取最后一个字符
记录-交流-Web开发知识分享
<?php 得到PHP中最后一个字符 $str = " www.wdphp.com "; $var = trim($str); len = $strlen($var)-1; echo $var{$len};
方法2:
<?php
$str = "www.wdphp.com";
echo substr($str, -1);