what's the difference in the following code?
- From: lamp.lists@xxxxxxxxx (Lamp Lists)
- Date: Fri, 17 Oct 2008 10:58:57 -0700 (PDT)
I'm reading "Essential PHP Security" by Chris Shiflett.
on the very beginning, page 5 & 6, if I got it correct, he said this is not good:
$search = isset($_GET['search']) ? $_GET['search'] : '';
and this is good:
$search = '';
if (isset($_GET['search']))
{
$search = $_GET['search'];
}
what's the difference? I really can't see?
to me is more the way you like to write your code (and I like the top one :-) )?
thanks.
-ll
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
- Follow-Ups:
- Re: [PHP] what's the difference in the following code?
- From: Chris Shiflett
- Re: [PHP] what's the difference in the following code?
- From: tedd
- Re: [PHP] what's the difference in the following code?
- From: "Dotan Cohen"
- Re: what's the difference in the following code?
- From: Carlos Medina
- Re: [PHP] what's the difference in the following code?
- From: "Eric Butera"
- Re: [PHP] what's the difference in the following code?
- From: "Richard Heyes"
- Re: [PHP] what's the difference in the following code?
- Prev by Date: Re: [PHP] Re: PHP Dev Facts
- Next by Date: Re: [PHP] what's the difference in the following code?
- Previous by thread: MYSQL insert problems
- Next by thread: Re: [PHP] what's the difference in the following code?
- Index(es):
Relevant Pages
|