|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-12-07 20:25 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 22:00:01 2025 UTC |
Description: ------------ It is necessary that I check to see if an array key has been set by the code. Such as is with this code: foreach($array as $key => $value){ if(is_int($key)) echo 'the code assigned a key for this element'; } How can I achieve this with the following array?: array('1'=>'Yes','0'=>'No'); PHP converts the '1' into 1 which leaves me no detection for user assigned keys. This is bad form. Reproduce code: --------------- --- From manual page: language.types.array ---