Re: Adding a more logical string slicing function to PHP
| From: | Chad Fulton | Date: | Wed, 30 Mar 2011 15:54:41 +0000 |
| Subject: | Re: Adding a more logical string slicing function to PHP | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51753@lists.php.net to get a copy of this message | ||
Hello!
While I personally like PHP's substr() an awful lot and doubt I would
use the str_slice() method, I thought I'd mention that I think what
you're proposing is much like the string.substring(from, to) method in
Javascript (and PHP's current substr() function is an awful lot like
Javascript's string.substr(start, end) method).
With that in mind, if this function was to be implemented, I think
that naming it substring() instead of str_slice() might make it easier
for people to pick up out of the box, since PHP developers often have
quite a bit of overlap with Javascript.
Chad