{"id":52,"date":"2011-09-30T02:12:28","date_gmt":"2011-09-30T10:12:28","guid":{"rendered":"http:\/\/www.tech.dimprash.com\/?p=52"},"modified":"2017-04-15T21:19:01","modified_gmt":"2017-04-16T05:19:01","slug":"checking-if-a-key-exists-in-an-array","status":"publish","type":"post","link":"http:\/\/www.tech.dimprash.com\/?p=52","title":{"rendered":"isset vs empty vs array_key_exists vs is_null"},"content":{"rendered":"<p>isset \u2014 Determine if a variable is set and is not NULL<\/p>\n<p>empty \u2014 Determine whether a variable is empty.  it will return true if the variable is an empty string, false, array(), NULL, \u201c0&#8243;, 0, and an unset variable.  (equivalent to !$var without the notice). empty() comes with quite a few caveats, since it considers the integer 0 and the string &#8220;0&#8221; to be empty (among other things).<\/p>\n<p>is_null \u2014 Finds whether a variable is NULL<br \/>\nis_null() is opposite of isset(), except for one difference that isset() can be applied to unknown variables, but is_null() only to declared variables<\/p>\n<p>array_key_exists  vs isset<\/p>\n<p><a href=\"http:\/\/www.php.net\/manual\/en\/function.isset.php\">isset()<\/a>\u00a0does not return\u00a0<strong><tt>TRUE<\/tt><\/strong>\u00a0for array keys that correspond to a\u00a0<strong><tt>NULL<\/tt><\/strong>\u00a0value, while\u00a0<strong>array_key_exists()<\/strong>\u00a0does.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>isset \u2014 Determine if a variable is set and is not NULL empty \u2014 Determine whether a variable is empty. it will return true if the variable is an empty string, false, array(), NULL, \u201c0&#8243;, 0, and an unset variable. (equivalent to !$var without the notice). empty() comes with quite a few caveats, since it &hellip; <a href=\"http:\/\/www.tech.dimprash.com\/?p=52\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">isset vs empty vs array_key_exists vs is_null<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-52","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=52"}],"version-history":[{"count":6,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/52\/revisions"}],"predecessor-version":[{"id":899,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/52\/revisions\/899"}],"wp:attachment":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}