Re: New string functions: str_startswith() and str_endswith()
| From: | Jani Taskinen | Date: | Mon, 21 Jul 2008 20:14:15 +0000 |
| Subject: | Re: New string functions: str_startswith() and str_endswith() | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39144@lists.php.net to get a copy of this message | ||
Paweł Stradomski kirjoitti:
W liście Rasmus Lerdorf z dnia poniedziałek, 21 lipca 2008:You people are funny.. --JaniIt also isn't any shorter: if(str_endswith($path,'.php')) vs. if(substr($path,-4)=='.php')Only if comparing to a static string, but not for this case: if (substr($path, -strlen($extension)) == $extension) Readability would also increase.