We get to know about new functions when we go through the documentation or its use. When I was working with CodeIgniter framework in PHP, i noticed the passing of variables from controller to views to something like:
These variables when passed to the views, they can be accessed as:
$data['username'] = 'abc';
$data['current_page'] = 'hello.html';
These variables when passed to the views, they can be accessed as:
echo $username;
echo $current_page;
It was all the use of php extract function that has this functionality.
So, for simplicity in accessing variables, this would be more useful.
More Information is available in http://php.net/manual/en/function.extract.php
FIND MORE!!!
0 comments:
Post a Comment