Bok
10-01-2005, 11:02 AM
Is it possible to access the value of variable A by using the value of variable B as it's name ??
For example, let's say I have 5 variables
a_name,b_name,c_name,d_name,e_name
I have an array defined as
$myarray = array(a,b,c,d,e);
foreach ($myarray as $myvalue) {
$newname = $myvalue . "_name";
# $newname will now = a_name for the first instance
}
is it possible to get the value of a_name by referencing $newname somehow ?
I think I can do this in perl, but not sure about php ????
:cheers:
Bok
For example, let's say I have 5 variables
a_name,b_name,c_name,d_name,e_name
I have an array defined as
$myarray = array(a,b,c,d,e);
foreach ($myarray as $myvalue) {
$newname = $myvalue . "_name";
# $newname will now = a_name for the first instance
}
is it possible to get the value of a_name by referencing $newname somehow ?
I think I can do this in perl, but not sure about php ????
:cheers:
Bok