hi i am having some problem
i am using two dimensional arrays
user[$userId][$codes] both userId and codes are arbitrary
i am storing somthing in this multidimensional array and to retrieve using
$sub="";
foreach(user as usr)
{
foreach(usr as cds)
{
//here i want the value of $codes how can i retrieve that
}
}
for example
if
user[01][123]=xxx
then i need 123 as a variable i want it to concatinate to $sub
please help
multidimesional array
Moderator: General Moderators
-
lokesh_kumar_s
- Forum Commoner
- Posts: 48
- Joined: Mon Apr 13, 2009 5:39 am
- Contact:
Re: multidimesional array
Code: Select all
<?php
$user = array();
$user[1][100]="this is hundred";
$user[1][101]= "this is hundred one";
$user[2][100]="user 2 hundred";
$user[2][101]="user 2 hundred one";
foreach($user as $usr)
{
foreach($usr as $code=>$description)
{
echo "$code";
//echo "Description is $description\n";
}
}
?>