Named pair array from variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is this even possible?  I'm building a string, properly formatted, to create 
a named pair or associative array.   The string is fine, and when I use it 
directly to create the array, all is well.  When I try to use the var to 
create the array, I get an empty array (I think).  Huh?

Here is what I have:

$myString = "'username' => 'password' , 'mickey' => 'mouse' , 'donald' => 
'duck'";
$myArray = array($myString);
print ("array val: $myArray[username]");   // get an empty string here




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux