[eluser]Unknown[/eluser]
Hi Codeigniter Community
I've been coding in Codeigniter for the last couple of weeks - and it really is amazing.
One thing is causing me some problems.
Consider this controller:
Code:
class main_page extends Controller {
function main_page()
{
parent::Controller();
}
function index()
{
if($variable_name) {
//Do something intelligent
}
}
}
This would trigger the "undefined variable" error. I know $variable_name isn't defined, but as far as I know, this isn't necessary in PHP.
Because of this I have been using the syntax
Code:
if(@$variable_name) {
//Do something intelligent
}
Is there a better way?