Re: HELP with arrays and URL (easy)

From: Date: Fri, 01 Dec 2000 23:45:13 +0000
Subject: Re: HELP with arrays and URL (easy)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-28321@lists.php.net to get a copy of this message
Well I'm not completely sure what you're saying... you have an echo statement and then another, but only the second one is "to view"?? Either way, it sounds like you're accessing the array by simply using it just like a scalar variable... ie, $myarr = Array("MyKey" => "MyVal"); echo $myarr; --will produce-- Array whereas $myarr = Array("MyKey" => "MyVal"); echo $myarr["MyKey"]; --will produce-- MyVal I think the problem lies in this line: echo"<a href=\"test2.php3?arr=$arr\">link</a>"; Does that help any? Toby Butzon [ criticism spurs improvement ] ----- Original Message ----- From: "Dallas Kropka" <dallask@firstworld.net> To: "PHP LIST" <php-general@lists.php.net> Sent: Saturday, December 02, 2000 8:51 AM Subject: [PHP] HELP with arrays and URL (easy) I am trying to pass an array through the URL with an echo statement, but all I ever get is the word Array... Im sure Im doing something stupid... this is what I'm doing... $arr = array ("somthing" => "here"); echo"<a href=\"test2.php3?arr=$arr\">link</a>"; and to view... $key = $arr[somthing]; echo("$arr[somthing]"); but all I get is either the letter A or Array.... how can I fix this? Thanks, Dallas K.

« previous php.general (#28321) next »