{"id":341,"date":"2015-08-20T22:03:26","date_gmt":"2015-08-20T14:03:26","guid":{"rendered":"http:\/\/genepeng.com\/?p=341"},"modified":"2015-08-20T23:32:03","modified_gmt":"2015-08-20T15:32:03","slug":"php-null-empty","status":"publish","type":"post","link":"https:\/\/www.genepeng.com\/index.php\/341","title":{"rendered":"php null empty"},"content":{"rendered":"<h2 class=\"title\">NULL<\/h2>\n<p class=\"para\">The special <strong><code>NULL<\/code><\/strong> value represents a variable with no value. <strong><code>NULL<\/code><\/strong> is the only possible value of type <span class=\"type\"><a class=\"type null\" href=\"http:\/\/php.net\/manual\/en\/language.types.null.php\">null<\/a><\/span>.<\/p>\n<p class=\"para\">A variable is considered to be <span class=\"type\"><a class=\"type null\" href=\"http:\/\/php.net\/manual\/en\/language.types.null.php\">null<\/a><\/span> if:<\/p>\n<ul class=\"itemizedlist\">\n<li class=\"listitem\">\n<p class=\"para\">it has been assigned the constant <strong><code>NULL<\/code><\/strong>.<\/p>\n<\/li>\n<li class=\"listitem\">\n<p class=\"para\">it has not been set to any value yet.<\/p>\n<\/li>\n<li class=\"listitem\">\n<p class=\"para\">it has been <span class=\"function\"><a class=\"function\" href=\"http:\/\/php.net\/manual\/en\/function.unset.php\">unset()<\/a><\/span>.<\/p>\n<\/li>\n<\/ul>\n<div class=\"refnamediv\">\n<hr \/>\n<h1 class=\"refname\">empty<\/h1>\n<p class=\"refpurpose\"><span class=\"refname\">empty<\/span> \u2014 <span class=\"dc-title\">Determine whether a variable is empty<\/span><\/p>\n<\/div>\n<div id=\"refsect1-function.empty-description\" class=\"refsect1 description\">\n<h3 class=\"title\">Description<\/h3>\n<div class=\"methodsynopsis dc-description\"><span class=\"type\">bool<\/span> <span class=\"methodname\"><strong>empty<\/strong><\/span> ( <span class=\"methodparam\"><span class=\"type\"><a class=\"type mixed\" href=\"http:\/\/php.net\/manual\/en\/language.pseudo-types.php#language.types.mixed\">mixed<\/a><\/span> <code class=\"parameter\">$var<\/code><\/span> )<\/div>\n<p class=\"para rdfs-comment\">Determine whether a variable is considered to be empty. A variable is considered empty if it does not exist or if its value equals <strong><code>FALSE<\/code><\/strong>. <span class=\"function\"><strong>empty()<\/strong><\/span> does not generate a warning if the variable does not exist.<\/p>\n<p class=\"para\">Returns <strong><code>FALSE<\/code><\/strong> if <code class=\"parameter\">var<\/code> exists and has a non-empty, non-zero value. Otherwise returns <strong><code>TRUE<\/code><\/strong>.<\/p>\n<p class=\"para\">The following things are considered to be empty:<\/p>\n<ul class=\"simplelist\">\n<li class=\"member\"><em>&#8220;&#8221;<\/em> (an empty string)<\/li>\n<li class=\"member\"><em>0<\/em> (0 as an integer)<\/li>\n<li class=\"member\"><em>0.0<\/em> (0 as a float)<\/li>\n<li class=\"member\"><em>&#8220;0&#8221;<\/em> (0 as a string)<\/li>\n<li class=\"member\"><strong><code>NULL<\/code><\/strong><\/li>\n<li class=\"member\"><strong><code>FALSE<\/code><\/strong><\/li>\n<li class=\"member\"><em>array()<\/em> (an empty array)<\/li>\n<li class=\"member\"><em>$var;<\/em> (a variable declared, but without a value)<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>NULL The special NULL value represents a variable with no value. NULL is the only possible value of type null. A variable is considered to be null if: it has been assigned the constant NULL. it has not been set to any value yet. it has been unset(). empty empty \u2014 Determine whether a variable &#8230; <a title=\"php null empty\" class=\"read-more\" href=\"https:\/\/www.genepeng.com\/index.php\/341\" aria-label=\"More on php null empty\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts\/341"}],"collection":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/comments?post=341"}],"version-history":[{"count":3,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts\/341\/revisions"}],"predecessor-version":[{"id":344,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts\/341\/revisions\/344"}],"wp:attachment":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/media?parent=341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/categories?post=341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/tags?post=341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}