Jump to content

Initialize variables?


Azu

Recommended Posts

The best programming practice, I personally believe is to define ALL my variables at the top of the script like so:

 

$username = '';//this will hold the username for the current user
$site_to_check = '';//this will hold the page the user was just one
$ip_address = '';//this holds the true/false statement if the user's ip address was banned or not

 

So I look at the top of my script, see all the variables, and I can almost always recognize what page I'm looking at or what each variable is meant to hold... Cause I often have those memory lapses where I forget everything I coded that night and such and such :-P

Link to comment
https://forums.phpfreaks.com/topic/76636-initialize-variables/#findComment-388336
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.