note 73344 deleted from function.ini-get by nlopess
| From: | nlopess@php.net | Date: | Fri, 23 Feb 2007 12:28:08 +0000 |
| Subject: | note 73344 deleted from function.ini-get by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123744@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
nothing to do with ini_get, just with the example:
getting the last char off a string by
<?php $last = strtolower($val{strlen($val)-1}); ?>
is deprecated (accessing characters in a string with {} is deprecated as of php 6) and ugly.
since substr() is no more expensive than strlen(), the simple and clear way is
<?php $last = strtolower(substr($val, -1)) ?>