PHP variable organization

bentro

New Member
Messages
2
Reaction score
0
Points
0
When you make long pages of php that you are using multi variables in, I recommend declaring the variables at the top of the page like this

PHP:
<?php
if(isset($_POST["var1"])){$var1==$_POST["var1"]}

//Content

?>
this makes the coding less confusing and easier to read
 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
I do that frequently, except I prefer to use !empty to check my variables. A variable can remain set even if has a NULL value.
 
Top