Re: [nyphp-talk] Is @$arr['key'] ok?

2008-03-10 Thread Kenneth Downs
Daniel Convissor wrote: On Mon, Mar 10, 2008 at 09:28:29AM -0400, Kenneth Downs wrote: function arraySafe($array,$key,$default='') { if(isset($array[$key])) return $array[$key]; else return $default; } Though this does get tripped up by $array[$key] being NULL. array_key_ex

Re: [nyphp-talk] Is @$arr['key'] ok?

2008-03-10 Thread Daniel Convissor
On Mon, Mar 10, 2008 at 09:28:29AM -0400, Kenneth Downs wrote: > > function arraySafe($array,$key,$default='') { > if(isset($array[$key])) > return $array[$key]; > else > return $default; > } Though this does get tripped up by $array[$key] being NULL. array_key_exists() is more accura

RE: [nyphp-talk] displaying error messages from PHP 5.2.4

2008-03-10 Thread alexey tkachenko
I am actually using IIS in this particular installation. But I guess restarting it would do the job as well? > Date: Mon, 10 Mar 2008 10:25:14 -0500 > From: [EMAIL PROTECTED] > To: talk@lists.nyphp.org > Subject: Re: [nyphp-talk] displaying error messages from PHP 5.2.4 > > You shouldn't have t

Re: [nyphp-talk] displaying error messages from PHP 5.2.4

2008-03-10 Thread Rolan Yang
You shouldn't have to reboot. Restarting (or stopping, then starting) apache should do the job. ~Rolan alexey tkachenko wrote: Thanks for your help! It seems like what I needed was a reboot of the system. The changes I made to php.ini file were applied after I rebooted, so I'm able to see

RE: [nyphp-talk] displaying error messages from PHP 5.2.4

2008-03-10 Thread alexey tkachenko
Thanks for your help! It seems like what I needed was a reboot of the system. The changes I made to php.ini file were applied after I rebooted, so I'm able to see the errors displayed properly now. > Subject: Re: [nyphp-talk] displaying error messages from PHP 5.2.4 > To: talk@lists.nyphp.

Re: [nyphp-talk] Is @$arr['key'] ok?

2008-03-10 Thread csnyder
On Mon, Mar 10, 2008 at 9:28 AM, Kenneth Downs <[EMAIL PROTECTED]> wrote: > > function arraySafe($array,$key,$default='') { > if(isset($array[$key])) > return $array[$key]; > else > return $default; > } > Yes, very useful pattern. Handy for grabbing input out of $_GET and $_POST ar

Re: [nyphp-talk] displaying error messages from PHP 5.2.4

2008-03-10 Thread anoland
Alexy, Turn on HTML errors. >; Disable the inclusion of HTML tags in error messages. >; Note: Never use this feature for production boxes. >html_errors = Off > ___ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NY

Re: [nyphp-talk] Is @$arr['key'] ok?

2008-03-10 Thread Kenneth Downs
Michael B Allen wrote: Is there any preference for: $val = isset($arr['key']) ? $arr['key'] : null; vs: $val = @$arr['key']; ? Oftentimes I like to check for a key value, and then supply a default if it is not there. It can be useful to make up a routine that does this for you all in o