Answers for "if object has property php"

PHP
2

php does property exist

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

php object check if property exists

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

Code answers related to "if object has property php"

Browse Popular Code Answers by Language