RE: [PHP-ES] Variables globales

From: Date: Fri, 26 Jan 2001 09:36:07 +0000
Subject: RE: [PHP-ES] Variables globales
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-6244@lists.php.net to get a copy of this message
pues haz un define Es decir, en vez de hacer esto: $esto_es_una_variable_global = 1; define("NOSEQUE",$esto_es_una_variable_global); function funcion_1() { echo NOSEQUE; } funtion funcion_2() { echo NOSEQUE; } ----- Original Message ----- From: Juan Jose Sanchez Mesa <juanjo.listas@doblej.net> To: <lista@phpes.com> Sent: Friday, January 26, 2001 9:32 AM Subject: [PHP-ES] Variables globales > Hola! > > Sabeis si hay alguna forma de definir una variable global para todas las > funciones para asi no tener que ir definiendola dentro de cada funcion ??? > > Es decir, en vez de hacer esto: > > $esto_es_una_variable_global = 1; > > function funcion_1() > { > global $esto_es_una_variable_global; > } > > funtion funcion_2() > { > global $esto_es_una_variable_global; > } > > Pues definir de alguna forma esa variable para no tener que poner el > 'global ...' dentro de cada funcion. > > Saludos! > Juanjo. > > > --------------------------------------------------------------------- > Archivo On-line: http://www.phpes.com/ > Manual PHP en español: http://www.php.net/manual/es/ > Para dar de baja la suscripción, mande un mensaje a: > lista-unsubscribe@phpes.com >

« previous php.general.es (#6244) next »