Re: Searching and getting values out of array maps

From: Date: Wed, 03 May 2006 12:56:54 +0000
Subject: Re: Searching and getting values out of array maps
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-235357@lists.php.net to get a copy of this message
Here's a stab... $colors = array("red"=>"#ff0000","gree"=>"#00ff00","blue"=>"#0000ff"); echo $colors["blue"]; should output #0000ff HTH -Brad Jonas Rosling wrote:
Hi all, I'm kind of new with PHP. I work alot with another language called Lasso, reminds kind of PHP but not the same. I trying to search after a desired value within an array map (think you call it like that in PHP) and to get the value out as well. Is this possible in any way? Like to show you how it works in Lasso while I'm talking about. Could look like this: <?LassoScript var: 'colors'=(map: 'red'='#ff0000', 'green'='#00ff00','blue'='#0000ff'); output: $clors->(find: 'blue'); ?> The result you get is #0000ff. Can you do something like this with PHP. Would help me alot if anyone could help me out a bit. Thanks in advance // Jonas


« previous php.general (#235357) next »