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

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

WBOY
Release: 2016-06-13 12:46:40
Original
797 people have browsed it

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template