<?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, 22 May 2013 04:23:31 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: PHP Returning Numeric Values in JSON]]></title>
      <guid>http://www.phpdeveloper.org/news/16577</guid>
      <link>http://www.phpdeveloper.org/news/16577</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has a <a href="http://www.lornajane.net/posts/2011/PHP-Returning-Numeric-Values-in-JSON">quick reminder</a> about an issue in the new <a href="http://joind.in/">joind.in</a> API version - everything was being returned as strings, even integers.
</p>
<blockquote>
A few weeks later (my inbox is a black hole and it takes a while to process these things) I fell over a throwaway comment to an undocumented constant JSON_NUMERIC_CHECK, and I added the constant name to my todo list. In the time it took for me to actually get around to googling for this, some wonderful person updated the PHP manual page (this is why I love PHP) to include it as a documented option, and someone else had added a user contributed note about using it.
</blockquote>
<p>
This option, JSON_NUMERIC_CHECK, tells the <a href="http://php.net/json_encode">json_encode</a> function to property consider numbers in its encoding process. It applies globally, so if there's an instance where you don't want something assigned as a number, you might need to go with another, more flexible JSON encoding option. You can find information about this and other possible options json_encode can take on <a href="http://us.php.net/json_encode">its manual page</a>.
</p>
]]></description>
      <pubDate>Tue, 12 Jul 2011 08:41:39 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Evert Pot's Blog: Numeric string comparison in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16249</guid>
      <link>http://www.phpdeveloper.org/news/16249</link>
      <description><![CDATA[<p>
In <a href="http://www.rooftopsolutions.nl/blog/numeric-string-comparison-in-php">this new post</a> to his blog <i>Evert Pot</i> reminds you (the PHP developer) about the loose and strict typing checks that you need to do when checking the values of your variables and never just assume. PHP's loose typing tendencies can cause issues if you're not paying attention.
</p>
<blockquote>
As long as you make sure you always use strict checking (=== and !==) where you can, and fall back to the loose checks when you must. As a PHP developer, I think it's very important to understand and memorize exactly how these work, whether you're writing new code, or maintaining existing code.
</blockquote>
<p>
He points out a specific example of some code that seems counter-intuitive when you compare how it reads and how it actually works (strings converted to floats and evaluated)
</p>
<blockquote>
The moral is: always do strict checks when you are able to.
</blockquote>]]></description>
      <pubDate>Tue, 26 Apr 2011 09:23:47 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ilia Alshanetsky's Blog: Type hinting for PHP 5.3]]></title>
      <guid>http://www.phpdeveloper.org/news/12798</guid>
      <link>http://www.phpdeveloper.org/news/12798</link>
      <description><![CDATA[<p>
One of the features included in the PHP 5.x releases is type hinting for validating that you have the right values for your functions and methods coming in. In <a href="http://ilia.ws/archives/205-Type-hinting-for-PHP-5.3.html">this new post</a> to his blog <i>Ilia Alshanetshy</i> takes a look at the the feature and gives a patch to add it .
</p>
<blockquote>
On a general level most people agree it would be a good idea to have, since it is an optional feature and does not introduce any regressions, heck you can even mix type hinted code with the non-type hinted one. The "PROBLEM" has always been combining of PHP's typeless nature with type hinting, which is where the consensus has been difficult (impossible) to reach.
</blockquote>
<p>
He mentions an example of why its such an issue (technically, both 1 and "1" are valid numbers) and includes <a href="http://ia.gd/patch/type_hint_53.txt">a link to a patch</a> that gives a new hint to help with the problem.
</p>]]></description>
      <pubDate>Thu, 02 Jul 2009 09:46:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mind Tree Blog: Friendly URLs in PHP: why do you care?]]></title>
      <guid>http://www.phpdeveloper.org/news/10492</guid>
      <link>http://www.phpdeveloper.org/news/10492</link>
      <description><![CDATA[<p>
<a href="http://www.hurricanesoftwares.com/2008/06/24/friendly-urls-in-php-why-do-you-care/">This new post</a> from the Mind Tree blog (at hurricanesoftware.com) asks the question "why do you care about friendly URLs in PHP applications?"
</p>
<blockquote>
Nice URLs, readable URLs, search-engine-friendly URLs. Different names same deal. [...] Turns out this isn't all that hard with PHP - in fact it can turn into something that's very useful from more than just a readability viewpoint.
</blockquote>
<p>
He shows how to <a href="http://www.hurricanesoftwares.com/2008/06/24/friendly-urls-in-php-why-do-you-care/">use mod_rewrite</a> and an .htaccess file to automatically grab the request and map it to the right place. Then, the PHP script looks at the incoming data and pushes the correct page back out to the browser. He's also included some modifications to the original idea that allow for numeric grouping and named groups for rewriting content.
</p>]]></description>
      <pubDate>Thu, 26 Jun 2008 10:26:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: The Switch Statement and Arrays]]></title>
      <guid>http://www.phpdeveloper.org/news/9368</guid>
      <link>http://www.phpdeveloper.org/news/9368</link>
      <description><![CDATA[<p>
DevShed continues their series looking at some of the fundamentals of working with PHP in <a href="http://www.devshed.com/c/a/PHP/PHP-The-Switch-Statement-and-Arrays/">this new tutorial</a> posted today. It looks at one of the flow control statements the language has to offer and a very useful data structure - the switch statement and arrays.
</p>
<blockquote>
In our last exciting adventure (back in early November), we braved crocodiles, ravenous editors, most of the PHP statements, and beginning loops. In this edition we'll cover the final statement, the Switch, and discuss arrays. So sit back, order your R2D2 robot to bring you a cold, frosty Jolt Cola, and let's get cracking.
</blockquote>
<p>
They start with a simple example of a switch statement (to echo out strings) and follow it with a detailed description of the different sorts of arrays - numeric indexed, associative and multidimensional versions. 
</p>]]></description>
      <pubDate>Mon, 07 Jan 2008 12:50:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: The Basics of Using the Factory Pattern in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/8126</guid>
      <link>http://www.phpdeveloper.org/news/8126</link>
      <description><![CDATA[<p>
DevShed revisits its series on using design patterns in PHP applications with <a href="http://www.devshed.com/c/a/PHP/The-Basics-of-Using-the-Factory-Pattern-in-PHP-5/">this new tutorial</a>, a look at implementing the Factory pattern in PHP 5.
</p>
<blockquote>
Summarizing, the factory pattern can be really useful when it comes to creating multiple objects that belong to the same family. In this three-part series I'm going to take a close look at it, and also demonstrate its remarkable functionality by showing you a decent variety of code samples, so you can start quickly including this pattern into your own PHP applications.
</blockquote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/The-Basics-of-Using-the-Factory-Pattern-in-PHP-5/">lay the foundation</a> by creating some basic factory classes for working with numeric and associative arrays. On top of this, they create the processing classes to create things like uppercase numeric arrays and lowercase associative arrays. Finally, they give examples of how to put it to use making several different sorts of arrays, including their output.
</p>]]></description>
      <pubDate>Tue, 26 Jun 2007 11:07:00 -0500</pubDate>
    </item>
  </channel>
</rss>
