Home  >  Article  >  Backend Development  >  我数据库里存储的ID号是C-13-667这像的,如何只读取最后一个横杠后边的数值

我数据库里存储的ID号是C-13-667这像的,如何只读取最后一个横杠后边的数值

WBOY
WBOYOriginal
2016-06-23 14:27:25878browse

我数据库里存储的ID号是C-13-667这像的,如何只读取最后一个横杠后边的数值

也就是667这个数


回复讨论(解决方案)

$s = 'C-13-667';$n = substr($s, strrpos($s, '-')+1);echo $n; //667

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn