Answers for "php check if obj attribute exists"

PHP
3

php check if object has attribute

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

php object check if property exists

property_exists( $object , "key1" ); // bool
Posted by: Guest on July-13-2021

Code answers related to "php check if obj attribute exists"

Browse Popular Code Answers by Language