<?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>Mon, 08 Sep 2008 05:23:20 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Hasin Hayder's Blog: Web scrapping in a smart way, making a "Today in History" object in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10063</guid>
      <link>http://www.phpdeveloper.org/news/10063</link>
      <description><![CDATA[<p>
<i>Hasin Hayder</i> has written up a <a href="http://hasin.wordpress.com/2008/04/29/web-scrapping-in-a-smart-way-making-a-today-in-history-object/">quick tutorial</a> for his blog that shows how to create your own "Today in History" page with details from <a href="http://www.scopesys.com/">Scopesys</a> pulled with a little web scraping.
</p>
<blockquote>
There are thousands of services available on web who are presenting interesting as well as education information which you can really integrate in your web page or make a nice widget and let others use them seamlessly with their content delivery platforms. In this article I am going to show you how you can make a nice Today-in-History widget with the help of the data provided in <a href="http://www.scopesys.com/">Scopesys</a>.
</blockquote>
<p>
He wisely recommends that you check one thing first about the content you're grabbing - the copyright it carries with it. This could get you into big trouble down the line depending on whose content it is. The actual script is pretty simple - he defines some constants as markers for where things start and stop in the HTML and then uses strpos to get the locations for his substr call to grab the segments.
</p>]]></description>
      <pubDate>Tue, 29 Apr 2008 10:27:41 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Christian Stocker's Blog: Calling PHP function from XSLT vs. native XSLT functions benchmark]]></title>
      <guid>http://www.phpdeveloper.org/news/5044</guid>
      <link>http://www.phpdeveloper.org/news/5044</link>
      <description><![CDATA[One of the more underused thechnologies to come along these days is XSLT - that powerful langauge to style XML documents in a simple, "more correct" kind of way (seperation of data and layout). Most languages have support for this combination, including PHP - but what's the best way to combine PHP and XSLT? <i>Christian Stocker</i> took a look in <a href="http://blog.bitflux.ch/archive/2006/03/26/calling-php-function-from-xslt-vs-native-xslt-functions-benchmark.html">this new post</a> on the Bitflux blog.
<p>
<quote>
<i>
After <a href="http://blog.bitflux.ch/archive/2006/03/25/xmlreader-and-xslt.html">Rob's idea from yesterday</a> about using XMLReader within XSLT I was wondering, how much of a slowdown calling PHP functions from XSLT is.
<p>
I wrote 4 different XSLT templates, which do a simple substring. One <a href="http://php5.bitflux.org/bench-xslt-php/xslt-only.xsl">with the xslt function "substring"</a>, one with <a href="http://php5.bitflux.org/bench-xslt-php/xslt-php.xsl">just calling the native PHP function "substr"</a> and one <a href="http://php5.bitflux.org/bench-xslt-php/xslt-php-userland.xsl">with calling a user-defined function</a> (which is also just calling "substr"). I called this 100 times (with one of those great recursive self-calling xslt-templates) and did call the "transformToXML" function a 100 times for each stylesheet. This means, we called the function 10'000 times for each benchmark run.
</i>
</quote>
<p>
His <a href="http://blog.bitflux.ch/archive/2006/03/26/calling-php-function-from-xslt-vs-native-xslt-functions-benchmark.html">bases the results</a> off of a sample with no function call at all and, but running it through 100 times, came up with results that weren't all that surprising. In order of speed, the ranking (shortest time first) was: no call, xslt only, php native, and php userland. Using the PHP functions from inside of XSLT made the test quite a bit slower, but, as he notes, most users won't be running recursions of 100 each time they run a script.]]></description>
      <pubDate>Mon, 27 Mar 2006 06:55:47 -0600</pubDate>
    </item>
  </channel>
</rss>
