Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

check if index exists in array php

// Here's our data array
$data = ['email', 'phone', 'name'];

// Use it in an `if` statement
if (array_key_exists("email", $data)) {
 // Do stuff because `email` exists
}
 
PREVIOUS NEXT
Tagged: #check #index #exists #array #php
ADD COMMENT
Topic
Name
8+2 =