Initializing Variables in PHP
by Amit Arora
Published: August 13, 2003
User Rating: 16,647,160.1 (258 votes)

Page Page » 1 2 3

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 :- )

Page Page » 1 2 3

Rate this article


  • 1
    Poor

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
    Great
 

About

Amit Arora is web developer with expertise in developing eCommerce enabled websites for the businesses.

Contact | Resume

Subscribe to newsletter




Get Firefox

Monitored by Site24x7
Uptime