Answers for "check if object has key php"

PHP
2

php check if object has attribute

if(property_exists($car,color)){
	//$car->color exists
}
Posted by: Guest on June-19-2019
1

php check if object has key

if (property_exists($ob, 'a'))
Posted by: Guest on September-10-2021

Code answers related to "check if object has key php"

Browse Popular Code Answers by Language