Re: getting rid of NOTICE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marek Kilimajer wrote:
Roger Thomas wrote:

I dont know how to explain this but when you work with an ldap attribute, they are case sensitive. jpegPhoto was what the schema was written with.

However when you retrieve that into PHP, you accessed them with all lower case. So accessing userPassword attribute in ldap will become userpassword in PHP.

Just to satisfy your curiosity, I have changed that to your advise with running the script produces identical result.


You can either:

1. prepend @ in front of the variable, which supresses notices and warnings
that's a very ugly use... If you're sure it'll throw a notice, then initialize the variable.

If you're unsure about aby of your variables, and don't want to appear as if you were a clean coder, you can set error_reporting(E_ALL&~E_NOTICE), which'll show E_ALL AND NOT E_NOTICE :)

2. use isset() or array_key_exists() to check for the existance of the key.

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux