News Feed
Sections




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

PHPMaster.com:
5 Inspiring (and Useful) PHP Snippets
July 02, 2012 @ 10:58:45

On PHPMaster.com there's a new tutorial that shares some useful PHP snippets that you could use in your development.

"X PHP Snippets" type articles abound on the Internet, so why write another one? Well, let's face itů the PHP snippets in them are generally lame. Snippets that generating a random string or return $_SERVER["REMOTE_ADDR"] for the IP Address of a client really aren't that interesting and are of modest usefulness. Instead, here's five snippets that you'll no doubt find interesting and useful, presented along with the problems that inspired them. I hope the creativity in many of them inspire you to write better and more creative code in your own day-to-day endeavors.

Their "five tips" are about:

  • Generating CSV files from an array of data
  • Autoloading classes (in a PSR-0 way)
  • Parsing data with the unpack function
  • Templating in HTML (creating a "View" object)
  • Using file_get_contents as a cURL Alternative
0 comments voice your opinion now!
snippets csv autoload unpack template filegetcontents


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Creating Template-Based Applications with HTML_Template_Flexy

Gonzalo Ayuso's Blog: PHP Template Engine Comparison. Part 2 (vs Plain PHP)

Zend Developer Zone: Creating Web Page Templates with PHP and Twig (part 2)

I/O Reader: 15 Cool Things & 12 Things to Dislike About PHP

Developer Tutorials Blog: 5 essential development facts every PHP developer should know


Community Events





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


podcast opinion configure install community symfony language composer voicesoftheelephpant conference release api laravel version series unittest list introduction extension interview

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