{"id":4,"date":"2006-10-19T13:57:34","date_gmt":"2006-10-19T11:57:34","guid":{"rendered":"http:\/\/blog.ansuz.nl\/index.php\/2006\/10\/19\/_post-empty-or-not\/"},"modified":"2009-05-03T18:01:23","modified_gmt":"2009-05-03T16:01:23","slug":"_post-empty-or-not","status":"publish","type":"post","link":"http:\/\/blog.ansuz.nl\/index.php\/2006\/10\/19\/_post-empty-or-not\/","title":{"rendered":"$_POST empty or not"},"content":{"rendered":"<p>Use <code>empty($_POST)<\/code> instead of an if containing <code>$_POST[0] == \"\"<\/code>. This gave me a lot of trouble to find out why there wasn&#8217;t anything sent by my mailer, who can receive variables using both GET and POST. Oops! :S<\/p>\n<p>This is valid obviously for any <strong>associative <\/strong>Array. \ud83d\ude09<\/p>\n<p>&#8211; the <a title=\"function documentation\" href=\"http:\/\/nl3.php.net\/manual\/en\/function.empty.php\" target=\"_blank\">empty()<\/a> function documentation<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Use empty($_POST) instead of an if containing $_POST[0] == &#8220;&#8221;. This gave me a lot of trouble to find out why there wasn&#8217;t anything sent by my mailer, who can receive variables using both GET and POST. Oops! :S This &hellip; <a href=\"http:\/\/blog.ansuz.nl\/index.php\/2006\/10\/19\/_post-empty-or-not\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-4","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/4","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/comments?post=4"}],"version-history":[{"count":0,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/4\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/media?parent=4"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/categories?post=4"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/tags?post=4"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}