Jump to content

is there an easier way to find the value of a key?


niche

Recommended Posts

This has to be accomplished with a known variable ($x) that doubles as a key and an array that may or may not contain the key in $x?$x = 'LAMS_ZV9014';$foo = array("LAMS_ZV9014" => "25.00" , "ABC" => "10.00" );if (array_key_exists($x, $foo)) { $bar = $foo['LAMS_ZV9014']; echo $bar;}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...