<?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:08:00 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[SitePoint PHP Blog: Mangling XML as Text with PHP DOM]]></title>
      <guid>http://www.phpdeveloper.org/news/10673</guid>
      <link>http://www.phpdeveloper.org/news/10673</link>
      <description><![CDATA[<p>
In trying to convert over several HTML pages to the <a href="http://dita.xml.org/">DITA XML</a> format, <i>James Edwards</i> came up against a problem involving recursion:
</p> 
<blockquote>
But a problem I came across several times was the sheer complexity of recursive element conversion '" &lt;code> becomes &lt;jsvalue> (or one of a dozen similar elements), &lt;a> becomes &lt;xref> ' and that's all simple enough; but each of these elements might contain the other, or further child elements like &lt;em>, and as we walk through the DOM so the incidence of potential recursion increases, until it gets to the point where my brain explodes. 
</blockquote>
<p>
His <a href="http://www.sitepoint.com/blogs/2008/07/24/mangling-xml-as-text-with-php-dom/">solution</a> involves working with both regular expressions and document fragments. He loads the node he wants to work with, its parsed to prepare it and is passed off to do the "text-based mangling" to update it. The result is them pushed back into an XML object (fragment) and this is pushed back into the main document with a replaceChild call.
</p>]]></description>
      <pubDate>Thu, 24 Jul 2008 09:35:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stefan Priebsch's Blog: Turning errors into exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/10080</guid>
      <link>http://www.phpdeveloper.org/news/10080</link>
      <description><![CDATA[<p>
In a <a href="http://inside.e-novative.de/archives/115-Turning-errors-into-exceptions.html">recent blog entry</a> <i>Stefan Priebsch</i> shows how to take an error thrown by your script and turn it into an exception (to make things like catchable fatal errors).
</p>
<blockquote>
While I would personally prefer an exception to be thrown in the first place, it is pretty easy to convert errors to exceptions in PHP.
</blockquote>
<p>
His example is pretty simple - you set a custom error handler in your script that pulls in the error information and tosses an exception based on the error number the handler is given. Then you can use the try/catch method to see if your script has tossed an exception of the fatal error type. Nice simple solution to handle an interesting little problem.
</p>]]></description>
      <pubDate>Wed, 30 Apr 2008 12:53:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Developer Tutorials Blog: Designing and Coding a Wordpress Theme From Scratch]]></title>
      <guid>http://www.phpdeveloper.org/news/10064</guid>
      <link>http://www.phpdeveloper.org/news/10064</link>
      <description><![CDATA[<p>
The Developer Tutorials blog has posted a series they've worked up to show bloggers out there running WordPress how to create a custom theme from scratch:
</p>
<blockquote>
In this multi-part series I'll detail how to create and design a Wordpress theme from nothing more than your imagination using Photoshop, CSS, XHTML and PHP.
</blockquote>
<p>Here's the list so far:</p>
<ul>
<li><a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/">Part 1</a> - getting the tools and an overall layout idea
<li><a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/">Part 2</a> - splitting it up to make the layout parts
<li><a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/">Part 3</a> - converting the Photoshop template to XHTML
<li><a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-4-147/">Part 4</a> - cleaning up the XHTML and doing some styling with CSS
<li><a href="http://www.developertutorials.com/blog/javascript/designing-and-coding-a-wordpress-theme-from-scratch-part-5-149/">Part 5</a> - how to preload some images with Javascript to make the page load faster
<li><a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-6-151/">Part 6</a> - creating the WordPress-specific markup
<li><a href="http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-7-153/">Part 7</a> - working up the PHP functionality
<li><a href="http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-8-154/">Part 8</a> - integrating PHP into the template
<li><a href="http://www.developertutorials.com/blog/php/designing-and-%E2%80%A6scratch-part-9designing-and-coding-a-wordpress-theme-from-scratch-part-9-159/">Part 9</a> - marking up the "framework" of the site (header/footer/sidebar)
<li><a href="http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-10-160/">Part 10</a> - adding additional files like a links page and changing the posting template
<li><a href="http://www.developertutorials.com/blog/php/packaging-a-wordpress-theme-for-distribution-162/">Part 11 (?)</a> - deploying the theme out to the public view
</ul>]]></description>
      <pubDate>Tue, 29 Apr 2008 11:17:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Securing Data Sent Via GET Requests]]></title>
      <guid>http://www.phpdeveloper.org/news/9243</guid>
      <link>http://www.phpdeveloper.org/news/9243</link>
      <description><![CDATA[<p>
PHPBuilder.com has a <a href="http://www.phpbuilder.com/columns/hillel_aftel20070510.php3">new article</a> by <i>Hillel Aftel</i> about his method of choice for securing the data that you send over the GET string when moving things around on your site.
</p>
<blockquote>
In this article I'm going to show you how you can use PHP to encode your data for transit. Most importantly, it will be done in a way that makes the data decodable, and therefore much more usable, by the receiving page.
</blockquote>
<p>
His encryption method - sending everything in a single string and modifying the scheme each time - uses static pairs of values (of your choosing) to "encode" the outgoing string. It actually consists of three different files: the script itself, a single-use script that makes the third file, an include file to handle the conversion back from the encoded results.
</p>]]></description>
      <pubDate>Fri, 14 Dec 2007 08:49:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Nessa's Blog: Convert Database to UTF-8]]></title>
      <guid>http://www.phpdeveloper.org/news/9237</guid>
      <link>http://www.phpdeveloper.org/news/9237</link>
      <description><![CDATA[<p>
<i>Nessa</i> has <a href="http://www.v-nessa.net/2007/12/06/convert-database-to-utf-8">posted a quick way</a> to convert a database from whatever character set it's currently on over to UTF-8 with a handy PHP script.
</p>
<blockquote>
When you're dealing with special characters in a database, you have to make sure that the charset and collation are dumped *with* the database, so that when you move it to another server the tables and data create properly. The biggest annoyance so far is converting tables back to UTF-8, as when this is done through the MySQL shell or phpmyadmin is had to be done table-by-table.
</blockquote>
<p>
<a href="http://www.v-nessa.net/2007/12/06/convert-database-to-utf-8">The script</a> logs into the database and pulls all of the table information out (could be a lengthy list depending on the database) and runs an ALTER TABLE to change its character set to 'UTF8'.
</p>]]></description>
      <pubDate>Thu, 13 Dec 2007 10:23:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin van Zonneveld's Blog: Convert anything to Tree Structures in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/8811</guid>
      <link>http://www.phpdeveloper.org/news/8811</link>
      <description><![CDATA[<p>
<i>Kevin van Zonneveld</i> has <a href="http://kevin.vanzonneveld.net/techblog/article/convert_anything_to_tree_structures_in_php/">posted a new example</a> today of how to convert anything into a tree structure with PHP:
</p>
<blockquote>
<p>
With a function on this site: explodeTree(), you can explode any single-dimensional array into a full blown tree. The function uses a user-specified delimiter found in the keys of the original array to separate nodes and determine hierarchy.
</p>
<p>
Sample: with 3 lines of code you could have a full directory hierarchy in a multi-dimensional array if you specify the delimiter to be a '/' (slash).
</p>
</blockquote>
<p>
Not only is the code included to make the tree from the data, but an example block of code showing how to use the result.
</p>]]></description>
      <pubDate>Tue, 09 Oct 2007 16:38:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Vexxblog: How to convert/encode files to FLV using FFMPEG & PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7919</guid>
      <link>http://www.phpdeveloper.org/news/7919</link>
      <description><![CDATA[<p>
From the Vexxblog, there's <a href="http://vexxhost.com/blog/2007/05/20/how-to-convertencode-files-to-flv-using-ffmpeg-php/">this new tutorial</a> that shows how, with FFMPEG and PHP, to convert and encode files to the FLV format.
</p>
<blockquote>
So, as I've written in an earlier article on how to install FFMPEG on your server, while there are those who probably use a 'YouTube Clone' script, there might be those who want to create their own using FFMPEG & PHP. FLV is the most widely used type of codec that runs on most Flash players.
</blockquote>
<p>
<a href="http://vexxhost.com/blog/2007/05/20/how-to-convertencode-files-to-flv-using-ffmpeg-php/">The tutorial</a> started with a diagram that outlines how the mini-app will work and is followed by the source. The script sets up the environment then grabs the file and sends it to the FFMPEG handler to be parsed and output as the FLV file (courtesy of a few handy command line parameters).
</p>]]></description>
      <pubDate>Fri, 25 May 2007 09:27:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[MySQL Performance Blog: Integers in PHP, running with scissors, and portability]]></title>
      <guid>http://www.phpdeveloper.org/news/7526</guid>
      <link>http://www.phpdeveloper.org/news/7526</link>
      <description><![CDATA[<p>
According to <a href="http://www.mysqlperformanceblog.com/2007/03/27/integers-in-php-running-with-scissors-and-portability/">this new post</a> on the MySQL Performance Blog, PHP has a bit of an issue when it comes to working with integers.
</p>
<blockquote>
<p>
Until recently I thought that currently popular scripting languages, which mostly evolved over last 10 years or something, must allow for easier portability across different platforms compared to ye good olde C/C++.
</p>
<p>
However, PHP just brought me a new definition of "portable" - and that was when working with... integers.
</p>
</blockquote>
<p>
He <a href="http://www.mysqlperformanceblog.com/2007/03/27/integers-in-php-running-with-scissors-and-portability/">points out</a> that PHP isn't able to correctly handle unsigned integers ("and converts values over 2^31 to signed"). He goes on to talk about how this differs between platforms too (32 vs 64 bit) and some of the research he did to find out just what was going on (including some code examples to illustrate the point).
</p>]]></description>
      <pubDate>Thu, 29 Mar 2007 09:30:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jacob Santos' Blog: PHP Blackjack]]></title>
      <guid>http://www.phpdeveloper.org/news/7158</guid>
      <link>http://www.phpdeveloper.org/news/7158</link>
      <description><![CDATA[<p>
In <a href="http://www.santosj.name/php-games-series/php-blackjack/">a new post</a> to his blog today, <i>Jacob Santos</i> shares a look at converting an application from one language to another - from C++ to PHP (obviously).
</p>
<blockquote>
The reason I'm revisiting blackjack is because I have a C++ version and I want to port it to PHP, for fun. If you want to have a simple project for learning a language, other than "Hello World," then Blackjack is a good project.
</blockquote>
<p>
Since Blackjack is a relatively simple game (as far as the rules go, that is) he chose a simple C++ version to port over. He sets up some guidelines first - break down the code into simple, reusable parts and keeping it as simple as possible. Most of the rest of the code is dedicated to the code:
<ul>
<li>Game start
<li>Statistics handling
<li>Randomization
<li>Looping
<li>Conditional statements
</ul>
The transition is pretty simple, really, especially with how flexible PHP is and the large number of built in functions it comes with.
</p>]]></description>
      <pubDate>Wed, 24 Jan 2007 08:58:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[IBM developerWorks: Convert XML to JSON in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7124</guid>
      <link>http://www.phpdeveloper.org/news/7124</link>
      <description><![CDATA[<p>
In <a href="http://devzone.zend.com/node/view/id/1591">this new post</a> on the Zend Developer Zone today, <i>Cal Evans</i> shares a link to an <a href="http://www-128.ibm.com/developerworks/xml/library/x-xml2jsonphp/">interesting article</a> over on the IBM developerWorks website. It deals with converting XML to JSON using PHP.
</p>
<blockquote>
With the growing popularity of Web 2.0, a new data interchange format called JavaScript Object Notation (JSON) is emerging as a useful way to represent data in the business logic running on browsers. Learn how PHP-based server programs can convert XML-formatted enterprise application data into JSON format before sending it to browser applications.
</blockquote>
<p>
<a href="http://www-128.ibm.com/developerworks/xml/library/x-xml2jsonphp/">The article</a> starts with the basics, XML and JSON, then moves quickly on to other topics like "browser-side data processing" and "xml-to-json conversion". From there, it's all about the code - creating the xml2json script to make the transition simple. It incorporates the Services_JSON package to help with the handling. 
</p>
<p>
The entire code is laid out in one block, making it simple to cut & paste and mess with a bit. They even include a sample of its usage as a command line script, complete with sample input and the resulting output.
</p>]]></description>
      <pubDate>Thu, 18 Jan 2007 14:32:00 -0600</pubDate>
    </item>
  </channel>
</rss>
