<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: isset vs. empty</title>
	<atom:link href="http://www.johnciacia.com/2010/01/09/isset-vs-empty/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnciacia.com/2010/01/09/isset-vs-empty/</link>
	<description>Science, Technology, and Beyond</description>
	<lastBuildDate>Sat, 21 Jan 2012 20:27:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Victor</title>
		<link>http://www.johnciacia.com/2010/01/09/isset-vs-empty/comment-page-1/#comment-7707</link>
		<dc:creator>Victor</dc:creator>
		<pubDate>Sat, 15 Jan 2011 20:20:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.johnciacia.com/?p=466#comment-7707</guid>
		<description>Good article. Just found another over at Tutorial Arena that takes a more in depth look at the difference between the two: &lt;a href=&quot;http://www.tutorialarena.com/blog/php-isset-vs-empty.php&quot; rel=&quot;nofollow&quot;&gt;PHP isset vs empty&lt;/a&gt; 
 
Hope these 2 articles help someone. </description>
		<content:encoded><![CDATA[<p>Good article. Just found another over at Tutorial Arena that takes a more in depth look at the difference between the two: <a href="http://www.tutorialarena.com/blog/php-isset-vs-empty.php" rel="nofollow">PHP isset vs empty</a></p>
<p>Hope these 2 articles help someone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lenny</title>
		<link>http://www.johnciacia.com/2010/01/09/isset-vs-empty/comment-page-1/#comment-7598</link>
		<dc:creator>Lenny</dc:creator>
		<pubDate>Sun, 05 Dec 2010 13:47:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.johnciacia.com/?p=466#comment-7598</guid>
		<description>Great advise. For my $_GET / POST / REQUEST I use this simple function to automatically check if the value is set and avoid any undefined index warnings.  
 
&lt;code&gt; 
//GET 
function GV($key,$default=&quot;&quot;){ 
   return (isset($_GET[$key])) ? $_GET[$key] : $default; 
} 
&lt;/code&gt; 
I did a quick write up about using this function here: &lt;a href=&quot;http://itslennysfault.com/quick-php-get-post-request-isset-function&quot; rel=&quot;nofollow&quot;&gt;quick php get post request isset function&lt;/a&gt; </description>
		<content:encoded><![CDATA[<p>Great advise. For my $_GET / POST / REQUEST I use this simple function to automatically check if the value is set and avoid any undefined index warnings. </p>
<p>&lt;code&gt;</p>
<p>//GET</p>
<p>function GV($key,$default=&quot;&quot;){</p>
<p>   return (isset($_GET[$key])) ? $_GET[$key] : $default;</p>
<p>}</p>
<p>&lt;/code&gt;</p>
<p>I did a quick write up about using this function here: <a href="http://itslennysfault.com/quick-php-get-post-request-isset-function" rel="nofollow">quick php get post request isset function</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.johnciacia.com/2010/01/09/isset-vs-empty/comment-page-1/#comment-7566</link>
		<dc:creator>John</dc:creator>
		<pubDate>Mon, 22 Nov 2010 07:09:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.johnciacia.com/?p=466#comment-7566</guid>
		<description>Thanks for pointing that out. I was more interested in describing the differences between the two functions rather than trying to provide &quot;best practice&quot; approach to using them. But you are right, my code will cause a notice to be displayed, and I will amend it to reflect your suggestions. </description>
		<content:encoded><![CDATA[<p>Thanks for pointing that out. I was more interested in describing the differences between the two functions rather than trying to provide &quot;best practice&quot; approach to using them. But you are right, my code will cause a notice to be displayed, and I will amend it to reflect your suggestions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ole</title>
		<link>http://www.johnciacia.com/2010/01/09/isset-vs-empty/comment-page-1/#comment-7565</link>
		<dc:creator>Ole</dc:creator>
		<pubDate>Mon, 22 Nov 2010 06:59:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.johnciacia.com/?p=466#comment-7565</guid>
		<description>forgot to mention this approach 
 
&lt;code&gt; 
$foo = (isset($_GET[&#039;foo&#039;])) ? $_GET[&#039;foo&#039;] : &#039;&#039;; 
if ($foo == &#039;&#039;) { ... code here ... } 
&lt;/code&gt; </description>
		<content:encoded><![CDATA[<p>forgot to mention this approach</p>
<p>&lt;code&gt;</p>
<p>$foo = (isset($_GET[&#039;foo&#039;])) ? $_GET[&#039;foo&#039;] : &#039;&#039;;</p>
<p>if ($foo == &#039;&#039;) { &#8230; code here &#8230; }</p>
<p>&lt;/code&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ole</title>
		<link>http://www.johnciacia.com/2010/01/09/isset-vs-empty/comment-page-1/#comment-7564</link>
		<dc:creator>Ole</dc:creator>
		<pubDate>Mon, 22 Nov 2010 06:57:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.johnciacia.com/?p=466#comment-7564</guid>
		<description>And what happens if $_GET[&#039;foo&#039;] is not defined? You will get &quot;Undefined index: foo&quot; error 
 
From my own experience you should always use isset() 
 
i.e: if ((isset($_GET[&#039;foo&#039;])) &amp;&amp; ($_GET[&#039;foo&#039;] == &quot;&quot;)) { ... your code here ... } </description>
		<content:encoded><![CDATA[<p>And what happens if $_GET[&#039;foo&#039;] is not defined? You will get &quot;Undefined index: foo&quot; error</p>
<p>From my own experience you should always use isset()</p>
<p>i.e: if ((isset($_GET[&#039;foo&#039;])) &amp;&amp; ($_GET[&#039;foo&#039;] == &quot;&quot;)) { &#8230; your code here &#8230; }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: query string and isset - CodeCall Programming Forum</title>
		<link>http://www.johnciacia.com/2010/01/09/isset-vs-empty/comment-page-1/#comment-7101</link>
		<dc:creator>query string and isset - CodeCall Programming Forum</dc:creator>
		<pubDate>Wed, 17 Feb 2010 17:20:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.johnciacia.com/?p=466#comment-7101</guid>
		<description>[...] query string and isset      isset vs. empty John Ciacia     [...]</description>
		<content:encoded><![CDATA[<p>[...] query string and isset      isset vs. empty John Ciacia     [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: social_experiment</title>
		<link>http://www.johnciacia.com/2010/01/09/isset-vs-empty/comment-page-1/#comment-7082</link>
		<dc:creator>social_experiment</dc:creator>
		<pubDate>Tue, 12 Jan 2010 07:24:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.johnciacia.com/?p=466#comment-7082</guid>
		<description>Good post, i recently [also] discovered that testing with a 0 will return true if empty() is used. The implications are obvious and since then i always check if the string is empty ( $variable == &#039;&#039; ) instead of using if ( empty($variable) ) </description>
		<content:encoded><![CDATA[<p>Good post, i recently [also] discovered that testing with a 0 will return true if empty() is used. The implications are obvious and since then i always check if the string is empty ( $variable == &#039;&#039; ) instead of using if ( empty($variable) )</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.johnciacia.com @ 2012-02-05 11:27:41 -->
