News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Tim's Blog:
Learn To extract()
January 19, 2006 @ 07:06:16

On Tim's blog today (Design by Tim), he has a new post that talks about "learning to extract()" - using this function to create variables based on $_GET and $_POST entries.

The days of explicitly declaring variables passed in from a form for use - or (gasp) using $_GET['varName'] in your code is no longer needed! Clear as well as clean code is the discussion for variable setting today, and we get to explore how easy it is to extract(), Typically you would have call the variable and then set it.

The world is changing. While that is not bad for small forms or simple tasks but what if your project is larger or lets just say after reading this article you abondon gathering all the $_GET data from your simple form?

He goes on to talk about the different flags that you can pass in for various options (like "overwrite existing variable" or "prefix variable names with this" sorts of things). Of course, this kind of methodology has to be used carefully so as not to create more security issues than it's worth...

3 comments voice your opinion now!
learn to extract option flag GET POST learn to extract option flag GET POST


blog comments powered by Disqus

Similar Posts

Job Posting: Tenbelowzero Seeks Senior PHP Developer (Oakville, Ontario)

Site News: Blast from the Past - One Year Ago in PHP

NetTuts.com: 20 Ways to Save Kittens and Learn PHP

Site News: Blast from the Past - One Year Ago in PHP

Job Posting: WorldNetJobs.com Seeks Expert PHP Developer (Multiple Locations - FL/MD/NY)


Community Events

Don't see your event here?
Let us know!


podcast community introduction language series programming api list application part2 project symfony example interview php7 composer laravel opinion framework yii2

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework