check whrew key in array have a value
// 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);<?php
$search_array = array('first' => 1, 'second' => 4);
if (array_key_exists('first', $search_array)) {
echo "The 'first' element is in the array";
}
?>
Also in PHP:
- encode and decode int to base64 using php
- asia time zone in php
- e_notice in php
- date time sql format php
- base64 to string pp
- date math sql php
- ajax jquery php
- base64 encode and decode in php
- display errors on
- datephp
- detect keyword of php string
- desired date in pgp
- PackageManifest.php line 131: Undefined index: name
- add one day in date php
- composer require laravel/ui for laravel 6
- How to display MySQL data dynamically using jQuery and PHP
- convert to format date php
- Route [login] not defined.Route [login] not defined.
- date du jour en php
- php check if string contains
- check if string contains substring php
- declare empty array php
- big int php
- php remove spaces from string