note 77595 deleted from ref.strings by felipe
| From: | felipe@php.net | Date: | Sun, 16 Dec 2007 14:44:25 +0000 |
| Subject: | note 77595 deleted from ref.strings by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133713@lists.php.net to get a copy of this message | ||
Note Submitter: janturon at email dot cz
----
be aware of this string behavior:
$array= "foo";
echo $array["bar"]; // "f"
explanation:
$array is string, so $array["bar"] is evaluated as $array[0] and this is the first
character of "foo".
if someone passes string into your associative array (get, post or cookie), it is security risk,
i.e.:
isset($array["user_exists"]); // true!
use array_key_exists() instead!