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

From: Date: Thu, 23 Oct 2008 19:48:26 +0000
Subject: Re: what's the difference in the following code?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-282377@lists.php.net to get a copy of this message
On Oct 17, 2008, at 1:58 PM, Lamp Lists wrote:
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?
The difference between the examples are still nothing, it do the same. But I never use the short version of if, because when I look after some month in some projects I have a better overview when there is a long if , its much easier to extend. sorry for my bad english greetz Thomas

« previous php.general (#282377) next »