note 47680 added to language.types.array

From: Date: Thu, 25 Nov 2004 02:54:31 +0000
Subject: note 47680 added to language.types.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-80999@lists.php.net to get a copy of this message
Note that dynamically creating arrays using the language construct array() does not work as expected. Eg: if $array_elements is constructed dynamically to contain the following value : $array_elements = "1=>'first',2=>'second',3=>'third'"; Trying to create an array type using: $my_array = array($array_elements); // OR $my_array = array("$array_elements"); will not give you the expected results. It yields an array of one element with the value as follows : [0] => 1=>'first',2=>'second',3=>'third' ---- Manual Page -- http://www.php.net/manual/en/language.types.array.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47680 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47680&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47680&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47680&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47680&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47680&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47680&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47680&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80999) next »