#23876 [Opn->Bgs]: Problem with multidimensional arrays
| From: | mgf@php.net | Date: | Fri, 30 May 2003 10:33:54 +0000 |
| Subject: | #23876 [Opn->Bgs]: Problem with multidimensional arrays | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-40697@lists.php.net to get a copy of this message | ||
ID: 23876
Updated by: mgf@php.net
Reported By: jkaufman at wamnet dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Mandrake Linux 9.1
PHP Version: 4.3.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
You want $value=${$tbl}['links'][$key] -- what you are trying is
equivalent to $value=${$tbl['links'][$key]}
Previous Comments:
------------------------------------------------------------------------
[2003-05-29 14:11:25] jkaufman at wamnet dot com
Given this data structure:
$user_master = array ('user_id'=>'user_id',
'user_name'=>'requester',
'user_login'=>'login_name',
'user_region_id'=>'user_region');
$user_master['links']['user_region_id']='region_master["region_id"]';
The idea is to have one or more entries to relate certain db fields to
other tables. If $tbl='user_master and $key='user_region_id', then if I
do this:
if (array_key_exists('links', $$tbl))...
I get a true response. The key exists.
However, I cannot access the values using any of these contructs:
$value=$$tbl['links'][$key]
$values=array_values ($$tbl['links'])
if (array_key_exists($key, $$tbl['links'])
etc. etc.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23876&edit=1