note 89780 added to function.isset
| From: | alexander dot holmback at gmail dot com | Date: | Mon, 23 Mar 2009 10:48:23 +0000 |
| Subject: | note 89780 added to function.isset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152318@lists.php.net to get a copy of this message | ||
$abc = 'test'
$abc is not an array, but you can use the brackets to reach a single byte in the string using
numbers.
$abc[0] = 't' //first letter in 'test'
$abc[1] = 'e' //second letter in 'test'
$abc[2] = 's' //third letter in 'test'
$abc[3] = 't' //fourth letter in 'test'
When using $abc['astring'], php will cast any string to 0 (see type juggling) which result
in the letter 't' which indeed is set. isset($abc['astring'] = isset($abc[0]) =
true.
----
Server IP: 80.67.2.2
Probable Submitter: 85.230.110.75
----
Manual Page -- http://www.php.net/manual/en/function.isset.php
Edit -- https://master.php.net/note/edit/89780
Del: integrated -- https://master.php.net/note/delete/89780/integrated
Del: useless -- https://master.php.net/note/delete/89780/useless
Del: bad code -- https://master.php.net/note/delete/89780/bad+code
Del: spam -- https://master.php.net/note/delete/89780/spam
Del: non-english -- https://master.php.net/note/delete/89780/non-english
Del: in docs -- https://master.php.net/note/delete/89780/in+docs
Del: other reasons-- https://master.php.net/note/delete/89780
Reject -- https://master.php.net/note/reject/89780
Search -- https://master.php.net/manage/user-notes.php