Skip to content

Instantly share code, notes, and snippets.

@zhouyuan24
Created March 10, 2014 08:20
Show Gist options
  • Save zhouyuan24/9461272 to your computer and use it in GitHub Desktop.
Save zhouyuan24/9461272 to your computer and use it in GitHub Desktop.
php截取最后一个字符串
$str = "1,2,3,4,5,6,";
$newstr = substr($str,0,strlen($str)-1);
echo $newstr;
@guke1991
Copy link

中文会乱码的样子……

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment