Bit hard to explain, but i want to be able to make an array like the following...
$blah=array(
7=>array(
username=>"chris",
email=>"chris@blah"
),
4=>array(
username=>"bob",
email=>"bob@blah",
),
);
but i'm trying to do it using the following code....
// Hurrah for dummy data.
$ids="7|4";
$names="Chris|Bob";
$emails="chris@blah|bob@blah";
$i_exp=explode("|",$ids);
$n_exp=explode("|",$names);
$e_exp=explode("|",$emails);
// Start an array...
$name_array=array();
for ($i=0;$i<=count($n_exp);$i++) {
array_push($name_array,$i_exp[$i],$n_exp[$i],$e_exp[$i]);
}
// Print out the array (i know this bit totally doesn't work)
for ($i=0;$i<=7;$i++) {
print $name_array[4]."<br>";
}
What i'm trying to do is to make a user record stored in an array, so all i would have to do is call
print $name_array[7]['username'];
etc
Thanks in advance.