test if value is in multidimensional array
Posted: Sun Jan 24, 2010 12:52 am
I have a multidimensional array and can't seem to get at the desired value "headline-inline". I know its there. I tried specifying the ['value'] along with the array name; but I got a warning. Here is the code:
And here is the array output:
Thank you for any help with this,
Scott
Code: Select all
<?php
if (in_array("headline-inline", $field_headline_options)) {
print "Found it"
}
?>
Code: Select all
[field_headline_options] => Array
(
[0] => Array
(
[value] => headline-inline
[safe] => headline-inline
[view] => Inline
)
[1] => Array
(
[value] => headline-color-black
[safe] => headline-color-black
[view] => Color: Black
)
[2] => Array
(
[value] => headline-size-medium
[safe] => headline-size-medium
[view] => Size: Medium
)
)
Scott