note 68409 added to language.types.array

From: Date: Tue, 25 Jul 2006 23:28:03 +0000
Subject: note 68409 added to language.types.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-115193@lists.php.net to get a copy of this message
in response to ch dot martin at gmail dot com If you are using the following code: <?php $r = array('05' => "abc", '35' => "def"); foreach ($r as $key=>$value) var_dump($key); ?> and you need the array key '35' to be a string (for looping maybe), you can make sure the key is a string by appending a 0 on the front. '035' instead of '35' ---- Server IP: 216.194.113.175 Probable Submitter: 207.135.154.122 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/language.types.array.php Edit -- http://master.php.net/note/edit/68409 Del: integrated -- http://master.php.net/note/delete/68409/integrated Del: useless -- http://master.php.net/note/delete/68409/useless Del: bad code -- http://master.php.net/note/delete/68409/bad+code Del: spam -- http://master.php.net/note/delete/68409/spam Del: non-english -- http://master.php.net/note/delete/68409/non-english Del: in docs -- http://master.php.net/note/delete/68409/in+docs Del: other reasons-- http://master.php.net/note/delete/68409 Reject -- http://master.php.net/note/reject/68409 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#115193) next »