note 73344 added to function.ini-get
| From: | Anonymous at osu1 dot php dot net | Date: | Sun, 18 Feb 2007 21:28:06 +0000 |
| Subject: | note 73344 added to function.ini-get | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123560@lists.php.net to get a copy of this message | ||
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)) ?>
----
Server IP: 69.147.83.197
Probable Submitter: 146.115.40.199
----
Manual Page -- http://www.php.net/manual/en/function.ini-get.php
Edit -- https://master.php.net/note/edit/73344
Del: integrated -- https://master.php.net/note/delete/73344/integrated
Del: useless -- https://master.php.net/note/delete/73344/useless
Del: bad code -- https://master.php.net/note/delete/73344/bad+code
Del: spam -- https://master.php.net/note/delete/73344/spam
Del: non-english -- https://master.php.net/note/delete/73344/non-english
Del: in docs -- https://master.php.net/note/delete/73344/in+docs
Del: other reasons-- https://master.php.net/note/delete/73344
Reject -- https://master.php.net/note/reject/73344
Search -- https://master.php.net/manage/user-notes.php