Originally posted by arevel
View Post
PHP extract
Collapse
X
-
Its not. extract() takes away your control. With manually retrieving it, you pass to your script only the keys you need.
-
Depends on the scope of your work but i usually try to avoid both methods. Its usually better to just use the cinventional $var = $_GET['key'] in time you will get to see that fetching all the values in $_GET can be bad. I just try to avoid lazy coding at all costs.Originally posted by shushant View PostWhich is better
why?Code:foreach ($_GET as $k => $v){ $$k = $v; } or extract( $_GET );
Leave a comment:
-
PHP extract
Which is better
why?Code:foreach ($_GET as $k => $v){ $$k = $v; } or extract( $_GET );Tags: None
Leave a comment: