![]() |
|
|
+ Search |
![]()
|
Mar 23rd, 2001 18:53
Ben Udall, Philippe Benaiche, http://www.php.net/manual/en/function.substr.php
If you give a negative length to the substr function, it starts from the end of the string. $str = "Hello world"; $num = 6; echo substr($str, 0, -$num); This outputs "Hello";