check if next key is array or object in php
// Here's our fruity array
$fruits = ['apple', 'pear', 'banana'];
// Use it in an `if` statement
if (array_key_exists("banana", $fruits)) {
// Do stuff because `banana` exists
}
// Store it for later use
$exists = array_key_exists("peach", $fruits);function findKey($array, $keySearch)
{
foreach ($array as $key => $item) {
if ($key == $keySearch) {
echo 'yes, it exists';
return true;
} elseif (is_array($item) && findKey($item, $keySearch)) {
return true;
}
}
return false;
}
Also in PHP:
- error show all php
- dd multiple variables laravel
- file_get_contents() ssl operation failed with code 1
- add array to array php
- base64 encode php and decode
- download php artisan
- Allowed memory size of 2147483648 bytes exhausted in laravel 6
- create seede for table in laravel
- check string has substring php
- codeigniter sms send
- CODE PPHP
- ahow php errors
- csv to json php
- customizing php time format based on location usa europe
- convert date and time to timestamp php
- amazon linux 2 php.ini changes not working
- check if array has index php
- comment split une chaine de caratere en php
- convert text toupper case php
- assign php array into javascript
- check if home page woocmerce
- array_key_exists($x, $p)
- check if string has a certain string php
- crear seeder laravel 8