Re: what's the difference in the following code?

From: Date: Sat, 18 Oct 2008 16:26:17 +0000
Subject: Re: what's the difference in the following code?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-282076@lists.php.net to get a copy of this message
2008/10/17 Lamp Lists <lamp.lists@yahoo.com>: > 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 > Chris posts here, you might want to stfa for his address and cc him the question to the list. Just be sure not to bug him offlist, that is generally frowned upon. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ä-ö-ü-ß-Ä-Ö-Ü

« previous php.general (#282076) next »