Php variables/arrays

Soldato
Joined
24 Nov 2002
Posts
16,379
Location
38.744281°N 104.846806°W
Is it possible to name an array based on two other variable names?

E.g.

$str1 . $str2 = = array();

So if strr1 = choc, str=cy, the array would be called "choccy"?
 
furnace said:
Why do you want to do that, anyway? (might be an alternative solution :))
As this isn't working:

Code:
$count = 0;
foreach ($arr_im_iname as &$id){
//blah blah blah
	foreach ($arr_im_iseq[$count] as &$id){
	echo $arr_im_iseq[$count][0];
	}
$count = $count +1;
}

Off out, will explain more late unless my flaw is obvious.
 
Jaffa_Cake said:
I do this :-)

Backend CMS system I am creating using the __construct function in a class and I only define one of the many classes.

$com_name = 'com_' . $this->comName;
${$com_name} = new $com_name;

It can come in use sometimes and is worth knowing :)
Que?
 
Back
Top Bottom