The array_key_exists() function is used to check whether a specified key is present in an array or not. The function returns TRUE if the given key is set in the array. The key can be any value possible for an array index.
Mar 8, 2021
9
Level 3
How can check if key exist in the array
I have a data in which some time raw not giving how can check if exist then
you can see my code
$request_url = $item['request']['url']['raw'];
Level 75
$request_url = $item['request']['url']['raw'] ?? $item['request']['url'] ?? null;
if ($request_url) {
//
}
2 likes
Please or to participate in this conversation.