{"id":789,"date":"2020-04-10T13:25:01","date_gmt":"2020-04-10T13:25:01","guid":{"rendered":"https:\/\/dapliw.org.ve\/?p=789"},"modified":"2020-04-10T13:25:01","modified_gmt":"2020-04-10T13:25:01","slug":"php-7-4-4-variables-globales","status":"publish","type":"post","link":"https:\/\/saemas.com\/sitio_web\/php-7-4-4-variables-globales\/","title":{"rendered":"PHP 7.4.4 &#8211; Variables globales"},"content":{"rendered":"<p>Hay varias formas de declarar una variable global en Php, una de ellas es declararla fuera de una funci\u00f3n y luego hacer referencia a ella con el arreglo GLOBALS[]. Ejemplo:<\/p>\n<pre><code>\/\/ Variables globales\n\n$ubicacionVendedor = true;\n\nfunction cambiar_valor_has_location( $has_location ) \n{\n    $GLOBALS['ubicacionVendedor'] = $has_location;\n    ...\n}<\/code><\/pre>\n<p>Fuente:<\/p>\n<p><a href=\"https:\/\/desarrolloweb.com\/articulos\/2457.php\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/desarrolloweb.com\/articulos\/2457.php<\/a><\/p>\n<p>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hay varias formas de declarar una variable global en Php, una de ellas es declararla fuera de una funci\u00f3n y luego hacer referencia a ella con el arreglo GLOBALS[]. Ejemplo: \/\/ Variables globales $ubicacionVendedor = true; function cambiar_valor_has_location( $has_location ) { $GLOBALS[&#8216;ubicacionVendedor&#8217;] = $has_location; &#8230; } Fuente: https:\/\/desarrolloweb.com\/articulos\/2457.php .<\/p>\n","protected":false},"author":1,"featured_media":790,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"material-hide-sections":[],"footnotes":""},"categories":[37],"tags":[38],"class_list":["post-789","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-php"],"_links":{"self":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/posts\/789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/comments?post=789"}],"version-history":[{"count":0,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/posts\/789\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/media?parent=789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/categories?post=789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/tags?post=789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}