I have an array like this, that could have any number of "domain" arrays. I've removed unnecessary keys in this example.
Array
(
[result] => success
[clientid] => 7
[numreturned] => 2
[domains] => Array
(
[domain] => Array
(
[0] => Array
(
[domainname] => example.net
)
[1] => Array
(
[domainname] => example.com
)
)
)
)
I need to figure out how to check this array to see if it contains a domain name.
I'm trying to do something like this:
if(arrayContains("example.com")){
$success = true;
}
I have tried a number of solutions I found on SO, but they don't appear to be working. One example I found used array_key_exists, which is kind of the opposite of what I need.
Any suggestions on how to do this?
array_search()
? - php.net/manual/fr/function.array-search.php#91365 – D4V1D 19 hours ago