php stdClass check for property exist

Change

if(property_exists($sale, gpps)) 

with

if(property_exists($sale, "gpps"))

notice how now gpps is passed as string, as per the signature of the property_exists function:

bool property_exists ( mixed $class , string $property )

This function checks if the given property exists in the specified class.

Note:
As opposed with isset(), property_exists() returns TRUE even if the property has the value NULL.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)