I agree. This will only lead to difficult bugs and maintenance nightmares. You should only pass exactly and explicitly what the function needs to process.AbraCadaver wrote:You can do this, however I would recommend one of the other solutions:larrygingras wrote:Unfortunately, no. It seems that it is not permitted to use function for default argument value: PHP Parse error: syntax error, unexpected '(', expecting ')' in /cd/home/admin/test.php on line 2
If the variables are global, then you can just use the $GLOBALS array in the safe_query() function.Code: Select all
safe_query('query', get_defined_vars());
Variable scope
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: