Initializing Variables in PHP
Published: August 13, 2003
User Rating: 16,647,160.1 (258 votes)
Code
The complete code of the initvar()
is as follows
/* initvar() * Initialize variables * © Amit Arora <digitalamit dot com> * Permission give to use this code for Non-Commericial, Commericial use * It would be appreciated if you could provide a link to the site */ function initvar() { foreach( func_get_args() as $v ) { if( is_array( $v ) ) { while( list( $key, $value ) = each( $v ) ) { $GLOBALS[$key] = ( !isset($GLOBALS[$key]) ? $value : $GLOBALS[$key] ); } } else { $GLOBALS[$v] = ( !isset($GLOBALS[$v]) ? '' : $GLOBALS[$v] ); } } }
At the end ...
If you have any concerns, or query, do mail me. Oh! and if you like the article, do forward it to your friends :- )
About
Amit Arora is web developer with expertise in developing eCommerce enabled websites for the businesses.

Monitored by Site24x7
Uptime