<?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>Fri, 08 Aug 2008 16:10:44 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Brian Moon's Blog: in_array is quite slow]]></title>
      <guid>http://www.phpdeveloper.org/news/10357</guid>
      <link>http://www.phpdeveloper.org/news/10357</link>
      <description><![CDATA[<p>
<i>Brian Moon</i> had <a href="http://brian.moonspot.net/2008/06/05/in_array-is-quite-slow/">a problem</a> - one of his cron jobs was lasting for much longer (hours!) than it should have been. He tweaked, tested and debugged the script and finally came down to a call to <a href="http://www.php.net/in_array">in_array</a>, something he comments on as being "quite slow".
</p>
<blockquote>
See, this job is importing data from a huge XML file into MySQL.  After it is done, we want to compare the data we just added/updated to the data in the table so we can deactivate any data we did not update. [...] We then compared the two arrays by looping one array and using in_array() to check if the value was in the second array. [...] So, that was running for hours with about 400k items.  Our data did not contain the value as the key, but it could as the value was unique.  
</blockquote>
<p>
He method, replacing the in_array call that had to do a full array scan for each time through the loop with an isset/unset combo on the unique key, changed the execution time down from about 4 hours to 0.8 seconds.
</p>]]></description>
      <pubDate>Fri, 06 Jun 2008 09:36:47 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Hasin Hayder's Blog: WorldTimeEngine - How about making your own in PHP?]]></title>
      <guid>http://www.phpdeveloper.org/news/9767</guid>
      <link>http://www.phpdeveloper.org/news/9767</link>
      <description><![CDATA[<p>
<i>Hasin Hayder</i> has <a href="http://hasin.wordpress.com/2008/03/01/worldtimeengine-how-about-making-your-own-in-php/">posted an example</a> of a "world time search" he's worked up that uses the geonames.org and Yahoo! developer APIs to pin down the time at any given location.
</p>
<blockquote>
I recently came by this site <a href="http://worldtimeengine.com/">WorldTimeEngine</a> where users can search the local time of any place using the name, street address or just latitude and longitude. Since that time I was thinking how easily you can make your own. As long there are some good people over there (For Geocoding API) - its a not a big deal, you know?
</blockquote>
<p>
His script pulls the location of the place (latitude/longitude) from the Yahoo! geocoding API and passes that back into the geonames web service to get the local time. The result is an array with the lat/long, address you submitted and the time output in a standard string.
</p>]]></description>
      <pubDate>Mon, 10 Mar 2008 11:17:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Developer Tutorials Blog: Give Your Visitors a Relative Time]]></title>
      <guid>http://www.phpdeveloper.org/news/9759</guid>
      <link>http://www.phpdeveloper.org/news/9759</link>
      <description><![CDATA[<p>
Following on the heels of <A href="http://www.phpdeveloper.org/news/9744">this post</a> to the SitePoint blog (about "roughtime"), <i>Akash Mehta</i> has posted <a href="http://www.developertutorials.com/blog/php/give-your-visitors-relative-time-php-69/">his own version</a> of providing users with something a little different - relative time.
</p>
<blockquote>
I understood the merits of the approach, but it struck me that a relative time might be a little more useful for many situations. For example, in a fast moving discussion, a short timestamp (e.g. 8:30 AM) as well as a verbal summary of how long ago the time was (e.g. "4 hours ago", "20 minutes ago") are most useful to the user. [...] Now, I figured this could be achieved very easily in PHP - and it could.
</blockquote>
<p>
His code <a href="http://www.developertutorials.com/blog/php/give-your-visitors-relative-time-php-69/">is included</a> showing a series of if/else comparisons that change the values to their hour/minute/second counterparts. He also recommends the <a href="http://pear.php.net/package-info.php?package=Numbers_Words">PEAR Numbers_Words package to help with readability.
</p>]]></description>
      <pubDate>Fri, 07 Mar 2008 11:19:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint WebTech Blog: Give Your Visitors a Rough Time]]></title>
      <guid>http://www.phpdeveloper.org/news/9744</guid>
      <link>http://www.phpdeveloper.org/news/9744</link>
      <description><![CDATA[<p>
In <a href="http://www.sitepoint.com/blogs/2008/03/06/give-you-visitors-a-rough-time/">a new post</a> to the Web Tech blog over on SitePoint, <i>Toby Somerville</i> has posted something he calls "RoughTime" - his method for displaying a more "human friendly" output of a timestamp.
</p>
<blockquote>
When asked the time, we generally don't need to be military accurate with our response [...] we generally communicate the approximate time. i.e. 'its nearly ten' or 'its just gone half past three'. Yet on the web, time is generally shown as '12:24:13 AM', or similar â'" not very visitor friendly.
</blockquote>
<p>
His <a href="http://www.sitepoint.com/blogs/2008/03/06/give-you-visitors-a-rough-time/">RoughTime</a> uses two switch statements to map the hour and minute values to different strings. For example, minutes between 15 and 20 become "quarter past" and the hours are changed over from numeric versions to their word counterparts.
</p>]]></description>
      <pubDate>Thu, 06 Mar 2008 08:44:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Leon Chevalier's Blog: Improve website load time by 500% with 3 lines of code]]></title>
      <guid>http://www.phpdeveloper.org/news/9477</guid>
      <link>http://www.phpdeveloper.org/news/9477</link>
      <description><![CDATA[<p>
<i>Leon Chevalier</i> has <a href="http://aciddrop.com/2008/01/21/boost-your-website-load-time-with-3-lines-of-code/">posted about a class</a> he's developed (you can download it <a href="http://aciddrop.com/2008/01/23/site-speed-boost-script-updated/">here</a>) that can help to speed up the load times for your site.
</p>
<blockquote>
There are 4 relatively easy ways by which you can speed up the time it takes a browser to download a page. Following on from my post on <a href="http://aciddrop.com/2008/01/03/automatically-join-your-javascript-and-css-into-a-single-file/">joining CSS and JavaScript files</a>, I have written a PHP script which will automatically do all of the above.
</blockquote>
<p>
He <a href="http://aciddrop.com/2008/01/21/boost-your-website-load-time-with-3-lines-of-code/">gives example code</a> of the class in action and includes some screenshots of the benchmarks from the <a href="http://developer.yahoo.com/yslow/">YSlow</a> Firefox extension showing the improvements.
</p>]]></description>
      <pubDate>Wed, 23 Jan 2008 12:09:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPWomen.org: elePHPants]]></title>
      <guid>http://www.phpdeveloper.org/news/9446</guid>
      <link>http://www.phpdeveloper.org/news/9446</link>
      <description><![CDATA[<p>
To help "sweeten the deal" a bit and encourage you to give towards the causes that the PHP Women are trying to accomplish, they're offering a special little bonus for those who donate at a certain level:
</p>
<blockquote>
Cal Evans from the <a href="http://devzone.zend.com">Zend DevZone</a> - being the awesome guy that he is - has graciously offered to mail out to the first 10 people who donate to PHPWomen $50 or more, a PHP elePHPant. Yep - you get one of the hard to find and much sought after plushy PHP elePHPants.
</blockquote>
<p>
You can find out more about the goals for their fund raising in <a href="http://www.phpwomen.org/wordpress/2008/01/16/support-a-good-cause/">this other post</a> to the PHPWomen.org blog as well as information on submitting whatever you feel like donating (time or money).
</p>]]></description>
      <pubDate>Fri, 18 Jan 2008 07:56:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Nessa's Blog: Common PHP Errors]]></title>
      <guid>http://www.phpdeveloper.org/news/9208</guid>
      <link>http://www.phpdeveloper.org/news/9208</link>
      <description><![CDATA[<p>
<i>Nessa</i> has <a href="http://www.v-nessa.net/2007/12/07/common-php-errors">set up a post</a> in an effort to help budding PHP developers out there with some of the most common problems they might come across in their work and how to handle them a bit more gracefully with error handling:
</p>
<blockquote>
I'm going back to the basics here, you know, when you wrote your first PHP script and saw an ugly-ass error message pop up on your screen? Error messages are the best tool a programmer has.
</blockquote>
<p>
She talks about how to set up the error reporting first, making sure that you're getting things up and useful. From there she describes some of the common errors that you might see including:
</p>
<ul>
<li>Parse errors
<li>MySQL Result source errors
<li>Stream errors
<li>Max Execution Time errors
</ul>
<p>
Check out <a href="http://www.v-nessa.net/2007/12/07/common-php-errors">the rest of the post</a> for more types.
</p>]]></description>
      <pubDate>Mon, 10 Dec 2007 12:05:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[David Goodwin's Blog: PHP DateTime vs mktime / strtotime in Propel]]></title>
      <guid>http://www.phpdeveloper.org/news/8695</guid>
      <link>http://www.phpdeveloper.org/news/8695</link>
      <description><![CDATA[<p>
<i>David Goodwin</i>, a developer on the <a href="http://propel.phpdb.org/">Propel project</a> has <a href="http://codepoets.co.uk/php-datetime-vs-mktime-strtotime-propel">posted about</a> a new feature included in the latest PHP version, the DateTime functionality, and how they put it to use in Propel.
</p>
<blockquote>
One of the relatively new features in PHP 5.2, is the <a href="http://php.net/date_create">DateTime</a> class/functions. It has a few useful functions (<a href="http://php.net/date_parse">date_parse</a>, <a href="http://php.net/date_date_set">date_date_set</a>, <a href="http://php.net/date_time_set">date_time_set</a> etc) which make dealing with dates and times easier (date_parse provides some useful error info too).
</blockquote>
<p>
He also mentions the ability of the functionality to handles dates before 1970 or after 2038, a common problem with PHP's native date functionality. He illustrates how it's useful by describing the change they made in Propel store DateTime objects instead of the integer timestamps like before.
</p>]]></description>
      <pubDate>Thu, 20 Sep 2007 12:52:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ryan Grove's Blog:  Minify combines, minifies &caches JavaScript & CSS files to speed up page loads]]></title>
      <guid>http://www.phpdeveloper.org/news/7782</guid>
      <link>http://www.phpdeveloper.org/news/7782</link>
      <description><![CDATA[<p>
<a href="http://wonko.com/article/519">This new entry</a> on <i>Ryan Grove</i>'s blog today points out a handy little tool written in PHP that can be used to (somewhat) reduce the time it takes for your pages to download.
</p>
<blockquote>
<a href="http://code.google.com/p/minify/">Minify</a> is a PHP library that attempts to fix this problem by combining multiple CSS or JavaScript files into one download. By default, it also removes comments and unnecessary whitespace to decrease the amount of data that must be sent to the browser. Most importantly, it does all of this on the fly and requires only a few simple changes to your existing web pages.
</blockquote>
<p>
He gives a <a href="http://wonko.com/article/519">before and after</a> example of the things it can do - mainly combining multiple tags (like link and script) and their information into one. Check out <a href="http://code.google.com/p/minify/">its page</a> on the Google Code site for more information.
</p>]]></description>
      <pubDate>Fri, 04 May 2007 16:52:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NewsForge.com: A DIY calendar control in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7173</guid>
      <link>http://www.phpdeveloper.org/news/7173</link>
      <description><![CDATA[<blockquote>
 As a former ASP.Net coder, I've missed the convenience of Microsoft's built-in Calendar Control since I switched to doing Web site development in PHP. On a recent project I needed the ability to display a calendar with dates serving as hyperlinks to selected database items. I decided to use the opportunity to write some portable PHP code that I could use in other projects.
</blockquote>
<p>
So started <i>Donald McArthur</i>'s <a href="http://programming.newsforge.com/programming/07/01/15/1420219.shtml">work on creating</a> a simple, easy to use calendaring system to be used in a popup inside an application. He provides all the code you'll need - the PHP code and the HTML layout/functionality you'll need to get it working.
</p>
<p>
He helps you visualize the structure of the end result HTML table with a simpler version (three cells by five cells) and <a href="http://programming.newsforge.com/programming/07/01/15/1420219.shtml">explains</a> the date functions the code uses to figure out the dates and days of the selected month.
</p>]]></description>
      <pubDate>Fri, 26 Jan 2007 15:25:00 -0600</pubDate>
    </item>
  </channel>
</rss>
