{"id":226,"date":"2014-07-10T09:06:42","date_gmt":"2014-07-10T09:12:40","guid":{"rendered":"https:\/\/b85d2php.code_.jpg"},"modified":"2015-07-16T17:14:58","modified_gmt":"2015-07-16T23:14:58","slug":"verificar-si-existe-el-indice-dado-en-un-array","status":"publish","type":"post","link":"https:\/\/emanuelpaxtian.com\/blog\/verificar-si-existe-el-indice-dado-en-un-array\/","title":{"rendered":"Verificar si existe el indice dado en un Array"},"content":{"rendered":"<p>Para verificar si un indice dentro de un array php cuenta con la funci\u00f3n\u00a0<strong>array_key_exists\u00a0<\/strong>la cual devuelve true o false<\/p>\n<p>jemplo de uso de esta funcion<\/p>\n<pre class=\"brush: php\">$array1= array('Primero' =&gt; 1, 'Segundo' =&gt; 4);\r\nif (array_key_exists('primero', $search_array)) {\r\n    echo \"Este elemento si esta definio\";\r\n}<\/pre>\n<p>si queremos verificar varios elementos se usa de esta forma<\/p>\n<pre class=\"brush: php\">if(array_key_exists_r('login|userio|password',$_GET)) {\r\n\/\/ Accesar\r\n} else {\r\n\/\/ denegar\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Para verificar si un indice dentro de un array php cuenta con la funci\u00f3n\u00a0array_key_exists\u00a0la cual devuelve true o false jemplo de uso de esta funcion $array1= array(&#8216;Primero&#8217; =&gt; 1, &#8216;Segundo&#8217;&hellip;<\/p>\n","protected":false},"author":1,"featured_media":464,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts\/226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/comments?post=226"}],"version-history":[{"count":0,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts\/226\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/media\/464"}],"wp:attachment":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/media?parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/categories?post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/tags?post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}