<?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>Sun, 07 Sep 2008 15:22:17 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Gareth Heyes' Blog: Regular expression challenge]]></title>
      <guid>http://www.phpdeveloper.org/news/8873</guid>
      <link>http://www.phpdeveloper.org/news/8873</link>
      <description><![CDATA[<p>
<i>Gareth Heyes</i> has posted <a href="http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/">another challenge</a> to his blog - this time it involves using a regular expression to convert the inputted string into the output he's given.
</p>
<blockquote>
After the success of my "<a href="http://www.thespanner.co.uk/2007/10/10/a-bit-of-fun/">a bit of fun</a>" challenge, a few people asked for some more challenges. So I was answering a question on a mailing list that I'm a member of and I thought it would be a good topic for a little challenge and help sharpen everyone's regular expression skills.
</blockquote>
<p>
This time, his <a href="http://www.thespanner.co.uk/2007/10/18/regular-expression-challenge/">challenge</a> involves taking the input, rail start/end locations from an array and, via the PHP script given (no regular expression in it, of course) make the output, a sort of JSON formatted message. It's already been answered, but if you want to, try it yourself first then read the answer below the post.
</p>]]></description>
      <pubDate>Fri, 19 Oct 2007 14:48:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP Security Blog: Holes in most preg_match() filters]]></title>
      <guid>http://www.phpdeveloper.org/news/7558</guid>
      <link>http://www.phpdeveloper.org/news/7558</link>
      <description><![CDATA[<p>
On the PHP Security Log today, <i>Stefan Esser</i> points out <a href="http://blog.php-security.org/archives/76-Holes-in-most-preg_match-filters.html">some holes</a> in most of the filters using preg_match that he's seen in examples and the like all around the web. Some of these things could cause issues that could breach the security of your application.
</p>
<blockquote>
<p>
During the last week I was performing some audits and like so often it contained preg_match() filters that were not correct. Most PHP developers use ^ and $ within their regular expressions without actually reading the documentation about what they really achieve.
</p>
<p>
However the problem is, that the author of such a regular expression did not correctly read the documentation and mistakes the $ character for the definitive end of the subject.
</p>
</blockquote>
<p>
According to <i>Stefan</i>, the actual documentation for the $ character in a regular expression isn't quite used that way. It does mean "the end" of the match but it can also match against a newline as well. His suggestions? Use the /D modifier on the end of the expression to match the real "the end" and not how it might match otherwise.
<p>]]></description>
      <pubDate>Wed, 04 Apr 2007 07:15:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[roScripts.com: PHP search engine]]></title>
      <guid>http://www.phpdeveloper.org/news/7534</guid>
      <link>http://www.phpdeveloper.org/news/7534</link>
      <description><![CDATA[<p>
The roScripts website has <a href="http://www.roscripts.com/PHP_search_engine-119.html">a new tutorial</a> that anyone just starting out to create a search engine with PHP and MySQL should get their hands...er eyes on. It steps through the creation of a simple PHP-based search engine, showing multiple methods to achieve the goal.
</p>
<blockquote>
The right search engine on your website won't bring you more traffic but it will help your visitors to better locate things so it will keep them on your pages. A good search engine implemented can increase your hits with almost 30% and this is tested. I'm not talking just to have a tutorial.
</blockquote>
<p>
The different methods <a href="http://www.roscripts.com/PHP_search_engine-119.html">the show how to implement</a> include:
<ul>
<li>using a straight LIKE on each word entered
<li>paring down those results using ORs on other columns too
<li>implementing the Porter Stemmer algorithm
<li>finding matches that contain the term but not only one part of it
<li>Full-text searches
</ul>
</p>
<p>
It's a good overview of some of the basic steps to getting your own search up and running, but some of them, when applied to sites with larger amounts of data behind them, wouldn't be useful at all (slowness mainly).
</p>]]></description>
      <pubDate>Fri, 30 Mar 2007 09:55:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Evolt.org: Working With Fractions In CSS and PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7256</guid>
      <link>http://www.phpdeveloper.org/news/7256</link>
      <description><![CDATA[<p>
Evolt.org has an <a href="http://evolt.org/working-with-fractions-in-css-and-php">interesting new article</a> posted today about combining CSS and PHP to display fractions correctly on your pages.
</p>
<blockquote>
Most of us are uncomfortable with using fractions when writing programs. If we encounter a fraction, we will first convert it into a floating point number (with decimals) and proceed from there. Most programming languages would prefer to use 0.5 as opposed to 1/2 because the later might conflict with the syntax of the languages. In this article, I will discuss my attempt to work with fractions in one of the PHP projects that I have done.
</blockquote>
<p>
They <a href="http://evolt.org/working-with-fractions-in-css-and-php">start with the CSS</a> to handle the output before moving into the PHP code. The code given will take in a decimal number and do its best to match it up with a fraction string value out of an array. The result is the echoed out with sup and sub tags to create the correct effect.
</p>]]></description>
      <pubDate>Mon, 12 Feb 2007 09:03:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Tiffany Brown's Blog: A better RegEx pattern for matching e-mail addresses]]></title>
      <guid>http://www.phpdeveloper.org/news/6880</guid>
      <link>http://www.phpdeveloper.org/news/6880</link>
      <description><![CDATA[<p>
Though not specifically related to PHP, I wanted to share <a href="http://tiffanybbrown.com/2006/12/12/a-better-regex-pattern-for-matching-e-mail-addresses/">a helpful tip</a> that <i>Tiffany Brown</i> has posted to her blog today - a nice, compact regular expression to handle the matching of email addresses.
</p>
<blockquote>
A few weeks ago, I posted a regular expression pattern < href="http://tiffanybbrown.com/2006/11/09/a-pattern-for-matching-e-mail-addresses/">for matching e-mail addresses</a>. Below is a more refined version:
</blockquote>
[php]
^[-+.w]{1,64}@[-.w]{1,64}.[-.w]{2,6}$
[/php]
<p>
Not only does it match the traditional email address formats, but it also will match addresses with periods in the name, British domains, and new TLDs like '.travel' or '.museum'.
</p>]]></description>
      <pubDate>Wed, 13 Dec 2006 08:15:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Dikini.net: Rewriting macros - the peculiar case of php]]></title>
      <guid>http://www.phpdeveloper.org/news/6062</guid>
      <link>http://www.phpdeveloper.org/news/6062</link>
      <description><![CDATA[<p>
On Dikiki.net today, there's <a href="http://dikini.net/16.08.2006/rewriting_macros_the_peculiar_case_of_php">a new post</a> that's a continuation of a series (<a href="http://www.phpdeveloper.org/news/5882">first post</a>, <a href="http://www.phpdeveloper.org/news/5923">second post</a>) dealing with macro programming in PHP.
</p>
<blockquote>
Without going into theoretical details, some of which are quite alien to me, I'll try to describe some of the challenges that pattern patching rewriting macros might pose for a language like php. After brief explanation what kind of a beast is this, I try to explore some of the finer points, which might cause problems. The intent of this post is to sketch a design and highlight some of the possible issues.
</blockquote>
<p>
He <a href="http://dikini.net/16.08.2006/rewriting_macros_the_peculiar_case_of_php">breaks up the post</a> into a few sections:
<ul>
<li>pattern matching rewrite only macros - a bird eye view
<li>Transformation time
<li>Basic/skeleton shapes and intermediate shapes
<li>Code generation issues specific to php
<li>Hygiene
<li>A rough macro shape outline
<li>Output/Status of the project
</ul>
There are code examples (of how it should work) and explainations of the issues PHP would face to accomplish this goal.
</p>]]></description>
      <pubDate>Thu, 17 Aug 2006 07:29:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Scott Johnson's Blog: Your Simple PHP Code Snippet for Monday]]></title>
      <guid>http://www.phpdeveloper.org/news/5332</guid>
      <link>http://www.phpdeveloper.org/news/5332</link>
      <description><![CDATA[<p>
Trying to find the HTML errors in a complex layout on a page can get very frustrating (especially when it repeats elements generated by backend scripts). <i>Scott Johnson</i> had one such instance, so he wrote a little script to help with it.
</p>
<quote>
<i>
<p>
I wasn't planning on blogging much today (or, honestly, this week) since we're making good progress on Ookles but our designer just had to deal with the situation where one of our developers clobbered our page footer w/ a comment gone astray and she wasted quite a bit of time analyzing the problem. Which, naturally, turned out to be nothing more than an unbalanced set of div tags. 
</p>
<p>
And since that's more often than not the problem these days with CSS bugs - at least for us - I whipped up a drop dead dumb div tag counter which seems to work but I suspect isn't perfect since its about as naive as you can get. 
</p>
</i>
</quote>
<p>
He has <a href="http://fuzzyblog.com/divcounter/index.txt">the source</a> of the script included in the post as well as two examples of using it with <a href="http://fuzzyblog.com/divcounter/?url=http://msn.com">msn.com</a> and <a href="http://fuzzyblog.com/divcounter/?url=http://news.com/">news.com</a>. Other suggestions of tools to help with these problems are listed in the comments - the <a href="http://jennifermadden.com/scripts/ViewRenderedSource.html">View Rendered Source</a> Firefox extension, and the <a href="https://addons.mozilla.org/firefox/249/">HTML Validator</a> for Firefox.
</p>]]></description>
      <pubDate>Tue, 09 May 2006 06:03:23 -0500</pubDate>
    </item>
  </channel>
</rss>
