<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 19 Jun 2013 00:00:07 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: 5 Inspiring (and Useful) PHP Snippets]]></title>
      <guid>http://www.phpdeveloper.org/news/18162</guid>
      <link>http://www.phpdeveloper.org/news/18162</link>
      <description><![CDATA[<p>
On PHPMaster.com there's a new tutorial that <a href="http://phpmaster.com/5-inspiring-and-useful-php-snippets/">shares some useful PHP snippets</a> that you could use in your development.
</p>
<blockquote>
"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.
</blockquote>
<p>Their "five tips" are about:</p>
<ul>
<li>Generating CSV files from an array of data
<li>Autoloading classes (in a PSR-0 way)
<li>Parsing data with the <a href="http://php.net/unpack">unpack</a> function
<li>Templating in HTML (creating a "View" object)
<li>Using file_get_contents as a cURL Alternative
</ul>]]></description>
      <pubDate>Mon, 02 Jul 2012 10:58:45 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Fetching Your Talks from the Joind.In API]]></title>
      <guid>http://www.phpdeveloper.org/news/18075</guid>
      <link>http://www.phpdeveloper.org/news/18075</link>
      <description><![CDATA[<p>
If you're a speaker (or even if you're not and just want to play with the API) and have information on <a href="http://joind.in">Joind.in</a>, <i>Lorna Mitchell</i> has a <a href="http://www.lornajane.net/posts/2012/fetching-your-talks-from-the-joind-in-api">quick way</a> you can pull you information from the site into an easy to use format.
</p>
<blockquote>
I've recently been thinking that I should also do a better job of linking through to the various talks I'm giving/have given - and at around the same time I was contacted by the good folk at mojoLive about integrating against joind.in. To cut a long story short, the joind.in API now has the functionality for users to retrieve their list of talks!
</blockquote>
<p>
Her <a href="http://www.lornajane.net/posts/2012/fetching-your-talks-from-the-joind-in-api">example</a> just uses a <a href="http://php.net/file_get_contents">file_get_contents</a> to pull the data from the remote URL in a JSON format. You don't need to be logged in to get to the talk information, though, so you won't need to bother with OAuth for this one. A snippet to loop through the results is also included.
</p>]]></description>
      <pubDate>Mon, 11 Jun 2012 08:31:30 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Gthub API: Issues List]]></title>
      <guid>http://www.phpdeveloper.org/news/15717</guid>
      <link>http://www.phpdeveloper.org/news/15717</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has a handy tip for those PHPers out there that use Github and want to pull off the issues from their project's Issues List quickly and easily - <a href="http://www.lornajane.net/posts/2011/Github-API-Issues-List">use their API</a> (super simple).
</p>
<blockquote>
I looked around for some export functionality for github but I got a lot of posts complaining it wasn't there. Since I hate applications that take your data and refuse to let you remove it, I was disappointed by this news but further inspection showed that although there might be no "export from github" button, there's <a href="http://develop.github.com/p/issues.html">an API that more than has it covered</a>.
</blockquote>
<p>
She gives an example of how to fetch only the currently open issues (the important ones) and pull then back through the API as a JSON message. Her little code snippet uses <a href="http://php.net/file_get_contents">file_get_contents</a>, but this can obviously be adopted to whatever use you might want. You can find out more about the things you can do with the Github API on the <a href="http://develop.github.com">develop.github.com</a> site including features to work with organizations, users, pull requests and <a href="http://gist.github.com">gists</a>.
</p>]]></description>
      <pubDate>Tue, 11 Jan 2011 09:56:26 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Quinton Parker's Blog: Try-catch suppress?]]></title>
      <guid>http://www.phpdeveloper.org/news/12176</guid>
      <link>http://www.phpdeveloper.org/news/12176</link>
      <description><![CDATA[<p>
In <a href="http://phpslacker.com/2009/03/19/try-catch-suppress/">this new entry</a> to his blog <i>Quinton Parker</i> looks at some strangeness he's found around the try/catch functionality in PHP. His specific example involves <a href="http://php.net/file_get_contents">file_get_contents</a>.
</p>
<blockquote>
PHP never ceases to amaze me. Just the other day a colleague discovered that you can suppress error messages reported by <a href="http://www.php.net/file_get_contents">file_get_contents()</a> using the try-catch statement. That should've raised an eyebrow.
</blockquote>
<p>
His sample code shows the normal error that a file_get_contents on a nonexistent file would give then wraps it in a try/catch. The same path is put into the file_get_contents but, because of some sort of interesting handling, isn't reported in the catch. He's at a loss and is asking for help figuring this one out from the readers out there. Be sure to <a href="http://phpslacker.com/2009/03/19/try-catch-suppress/#comments">leave a comment</a> if you have more info.
</p>]]></description>
      <pubDate>Fri, 20 Mar 2009 07:56:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kae Verens' Blog: efficient JS minification using PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10232</guid>
      <link>http://www.phpdeveloper.org/news/10232</link>
      <description><![CDATA[<p>
In a <a href="http://verens.com/archives/2008/05/20/efficient-js-minification-using-php/">new post</a> today, <i>Kae Verens</i> takes a look at a method for easy and quick javascript minification with help from a little bit of PHP.
</p>
<blockquote>
A useful part of minification is that during the act of compiling your minified source, you can also pull in other JavaScript files and compiled them all into one single source. This has a major advantage that there is only one file to download.
</blockquote>
<p>
The <a href="http://verens.com/archives/2008/05/20/efficient-js-minification-using-php/">method</a> runs a <a href="http://www.php.net/file_get_contents">file_get_contents</a> on each of the javascript files, and pulls their content into a single PHP variable. This value is then just echoed out after it's passes through <a href="http://code.google.com/p/jsmin-php/">this minimizer class</a>. 
</p>
<p>
<i>Kae</i> also offers an alternative to performing this expensive operation each time - caching then checking the md5 hash of the cache to see if it's different than the current version. Example code is included.
</p>]]></description>
      <pubDate>Wed, 21 May 2008 10:25:35 -0500</pubDate>
    </item>
  </channel>
</rss>
