x27;THREE'";
$b = "3";
$data1 = array('ONE'=>1,'TWO'=>2);
$data2[$a] = $b;
$test = $data1 + $data2;
-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 1:54 AM
To: PHP
Subject: Re: [PHP] Plea
Try eval(), like this:
$str= "'THREE'=>3, 'FOUR'=>4";
eval("\$data2 = array('ONE'=>1,'TWO'=>2,$str);");
Max Sullivan wrote:
>I am trying to populate array values and keys from a variable with no
>luck.
>
>Lets say I have the following array.
>
>$data1 = array('ONE'=>1,'TWO'=>2,'THREE'=>3,'FOU
I am trying to populate array values and keys from a variable with no
luck.
Lets say I have the following array.
$data1 = array('ONE'=>1,'TWO'=>2,'THREE'=>3,'FOUR'=>4);
And I want to create part of the array with the string below:
$str= "'THREE'=>3, 'FOUR'=>4";
$data2 = array('ONE'=>1,'TWO'=
3 matches
Mail list logo