Home >Backend Development >PHP Tutorial > PHP的substr函数怎么完全模拟ASP的right函数

PHP的substr函数怎么完全模拟ASP的right函数

WBOY
WBOYOriginal
2016-06-13 12:46:40806browse

PHP的substr函数如何完全模拟ASP的right函数
有人说substr能完全取代ASP的right函数
//right (x)
substr($str,-x); 

但如果x=0时,就完全不能取代了,有什么办法可以当x=0时,也用substr取代吗

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