Say I have an array called $myarray like this...
[187] => 12
[712] => 24
Within a loop later in my code, i want to check to see if a key exists in that array and if it does, i want to assign the corresponding value to a variable.
So I'd check like this...
if (array_key_exists($id), $myarray)) {
$newvariable= "(the value that goes with the index key)";
} else {
$newvariable="";
}
So if it checked for key "187", then $newvariable would be assigned "12";
I guess I just need to know what to replace "(the value that goes with the index key)" with. Or maybe I'm approaching it wrong?