php if csrf exists code example
Example 1: php key exists
// 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);
Example 2: javascript if field exists
const hero = {
name: 'Batman'
};
hero.hasOwnProperty('name'); // => true
hero.hasOwnProperty('realName'); // => false