<?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, 24 May 2013 05:15:18 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Project: Patchwork-UTF8 - UTF8 Support for PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17458</guid>
      <link>http://www.phpdeveloper.org/news/17458</link>
      <description><![CDATA[<p>
<i>Nicolas Grekas</i> has shared another tool that he's pulled out of his "Patchwork" framework to make it a stand-alone tool: the <a href="https://github.com/nicolas-grekas/Patchwork-UTF8">Patchwork-UTF8 helper</a> that provides matching functions to those PHP already has for regular strings, but a little smarter to work with UTF8 correctly.
</p>
<blockquote>
The PatchworkUtf8 class implements the quasi complete set of string functions that need UTF-8 grapheme clusters awareness. These functions are all static methods of the PatchworkUtf8 class. The best way to use them is to add a use PatchworkUtf8 as u; at the beginning of your files, then when UTF-8 awareness is required, prefix by u:: when calling them.
</blockquote>
<p>
In <a href="https://github.com/nicolas-grekas/Patchwork-UTF8/blob/master/README.md">the README</a> for the tool he talks about the functions included in the current release that match PHP's string functions as well as some additional methods like "isUtf8", "bestFit" and "strtocasefold". It relies on the mbstring, iconv and intl extensions being installed, and if they aren't, it falls back to other functionality (list of those methods included).
</p>]]></description>
      <pubDate>Fri, 27 Jan 2012 11:38:40 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Evert Pot's Blog: iconv_substr vs mbstring_substr]]></title>
      <guid>http://www.phpdeveloper.org/news/16934</guid>
      <link>http://www.phpdeveloper.org/news/16934</link>
      <description><![CDATA[<p>
<i>Evert Pot</i> came across an interesting performance issue as he was working through an application that needed to do some string substitutions - the difference between <a href="http://www.rooftopsolutions.nl/blog/iconv_substr-vs-mbstring_substr">iconv_substr, mb_substr and substr</a>.
</p>
<blockquote>
While working on an application I ran across a huge bottleneck which I isolated down all the way to the use of the iconv_substr function. If you ever wonder which is better to use, [the benchmark code in the post[ should help your decision.
</blockquote>
<p>
His results changed quite a bit from machine to machine (and OS/platform to OS/platform) but one statistic stood out on them all - the <a href="http://php.net/iconv_substr">iconv_substr</a> was slower than <a href="http://php.net/mb_substr">mb_substr</a> method....by a lot in one case (about 2100000% slower).
</p>]]></description>
      <pubDate>Fri, 30 Sep 2011 11:03:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ahmed Shreef's Blog: iconv misunderstands UTF-16 strings with no BOM]]></title>
      <guid>http://www.phpdeveloper.org/news/15035</guid>
      <link>http://www.phpdeveloper.org/news/15035</link>
      <description><![CDATA[<p>
<i>Ahmed Shreef</i> has <a href="http://shreef.com/2010/08/iconv-misunderstands-utf-16-strings-with-no-bom/">a recent post</a> to his blog about an issue he had converting UTF-16 strings over to UTF-8 with the <a href="http://php.net/iconv">iconv</a> functionality in PHP. Specifically, he ended up with "rubbish unreadable characters" after the conversion.
</p>
<blockquote>
I had a problem last week with converting UTF-16 encoded strings to UTF-8 using PHP's iconv library on a Linux server. my code worked fine on my machine but the same code resulted in a rubbish unreadable characters on our production server.
</blockquote>
<p>
In his example (a basic "Hello World" in Arabic) he notes that there's no <a href="http://en.wikipedia.org/wiki/Byte-order_mark">byte order mark</a> on the string and, because of this, the iconv feature tries to guess if it's big-endian or little-endian. This guessing varies from machine to machine resulting in the inconsistencies he saw. The solution is to define the "to" and "from" for the conversion manually rather than letting it just guess.
</p>]]></description>
      <pubDate>Fri, 27 Aug 2010 13:36:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NETTUTS.com: How to Create Blog Excerpts with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/14840</guid>
      <link>http://www.phpdeveloper.org/news/14840</link>
      <description><![CDATA[<p>
On NETTUTS.com today <a href="http://net.tutsplus.com/tutorials/php/how-to-create-blog-excerpts-with-php/">there's a tutorial</a> (a screencast) that'll show you how to create excerpts for the posts in your blog. Their method could be applied to just about any PHP-based blog software out there since it uses base PHP functions and MySQL features.
</p>
<blockquote>
Ever visited a blog, and noticed that each posting's overview only contained a hundred characters or so, which is then followed by '''? Ever wondered how to do that yourself? It's not quite as easy as you might think. What if character number 100 occurs in the middle of a word? Do you want to display half of a word on the page? Of course not. In this video tutorial, I'll show you how to compensate for this, as well as a host of other neat little things, like working with MySQL's LEFT() function, using PHP's strrpos, and substr, creating the beginning's of an actual blog, and more.
</blockquote>
<p>
They show you how to use the MySQL LEFT() function, <a href="http://php.net/strrpos">strrpos</a> and <a href="http://php.net/substr">substr</a> to make creating these summary blocks of text simple.
</p>]]></description>
      <pubDate>Fri, 23 Jul 2010 09:11:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Yannick's Blog: mbstring vs iconv benchmarking]]></title>
      <guid>http://www.phpdeveloper.org/news/11153</guid>
      <link>http://www.phpdeveloper.org/news/11153</link>
      <description><![CDATA[<p>
Recently on his blog <i>Yannick</i> has done some benchmarking <a href="http://dokeoslead.wordpress.com/2008/10/05/mbstring-vs-iconv-benchmarking/">comparing mbstring and iconv</a> in PHP 5.2.4 release.
</p>
<blockquote>
Following up on <a href="http://dokeoslead.wordpress.com/2008/04/22/mbstring-vs-iconv/">my previous post</a> about the differences between the mbstring and iconv international characters libraries (which resulted in a tentative conclusion that nobody knew anything about those differences), and particularly the comments by <a href="http://www.entidi.it/">Nicola</a>, we have combined forces (mostly efforts from Nicola, actually) to provide you with a little benchmarking, if that can help you decide.
</blockquote>
<p>
His code for the test script is included (for you to gather your own results) and a full listing of his results comparing the effects of possible caching, running up to ten executions. You can download the text file that he ran the script on <a href="http://mirror3.mirrors.tds.net/pub/gutenberg.org/1/3/0/8/13083/13083-utf8.txt">here</a>.
</p>]]></description>
      <pubDate>Mon, 06 Oct 2008 12:50:20 -0500</pubDate>
    </item>
    <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[Dokeos Blog: mbstring vs iconv]]></title>
      <guid>http://www.phpdeveloper.org/news/10034</guid>
      <link>http://www.phpdeveloper.org/news/10034</link>
      <description><![CDATA[<p>
In <a href="http://dokeoslead.wordpress.com/2008/04/22/mbstring-vs-iconv/">this post</a> on the Dokeos blog, there's a comparison of the <a href="http://www.php.net/mbstring">mbstring</a> function and the <a href="http://php.net/iconv">iconv</a> library as it pertains to their use on multi-byte strings.
</p>
<blockquote>
I was wondering today why use mbstring rather than iconv in Dokeos, and honestly I didn't remember exactly why I had chosen mbstring in the past, but finding information about the *differences* between the two. [...] Searching a bit more, I found a <a href="http://www.nyphp.org/content/presentations/smallworld/April2006-nyphp-Presentation.ppt">PPT presentation</a> from Carlos Hoyos on Google.
</blockquote>
<p>
Essentially, it boils down to how the library is integrated - mbstring is bundled and iconv is pulled from an external source. So, if you're looking for maximum portability, he recommends mbstring.
</p>]]></description>
      <pubDate>Thu, 24 Apr 2008 11:18:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Riff Blog: Console encoding in PHP-GTK apps]]></title>
      <guid>http://www.phpdeveloper.org/news/6738</guid>
      <link>http://www.phpdeveloper.org/news/6738</link>
      <description><![CDATA[<p>
PHP-GTKers working in English-related applications, don't have a problem with debugging messages output to a console when debugging, but applications on a more international front have issues with their output. But help has been found in <a href="http://blog.riff.org/2006_11_19_console_encoding_in_php_gtk_apps">this new post</a> on the Riff Blog - a method for correctly encoding PHP-GTK applications.
</p>
<blockquote>
<p>
PHP scripts are typically stored under UTF-8 encoding to limit i18n headaches, while the console in which their output will be displayed is normally configured to some regional encoding, like IBM850 in Windows/XP French.
</p>
<p>
So we need a workaround...
</p>
</blockquote>
<p>
He splits <a href="http://blog.riff.org/2006_11_19_console_encoding_in_php_gtk_apps">the process</a> out into a few steps, each with its own explanation and code:
<ul>
<li>Builtin tools
<li>Buffering
<li>Flushing
<li>PHP-GTK is not PHP for the Web
<li>Auto-flushing
</ul>
All wrapped up with a final solution - using the iconv functionality in combination with some output buffering to correctly display the message.
</p>]]></description>
      <pubDate>Mon, 20 Nov 2006 10:58:00 -0600</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>
    <item>
      <title><![CDATA[Christian Stocker's Blog: PHP 5, OS X, fink and iconv]]></title>
      <guid>http://www.phpdeveloper.org/news/4622</guid>
      <link>http://www.phpdeveloper.org/news/4622</link>
      <description><![CDATA[<i>Christian Stocker</i> has <a href="http://blog.bitflux.ch/archive/2006/01/06/php-5-os-x-fink-and-iconv.html">a quick new post</a> with a solution for those Mac users out there that would like to use the iconv extension with fink.
<p>
<quote>
<i>
If you want to get the iconv extension properly running with PHP 5 and <a href="http://fink.sf.net/">fink</a> on OS X, you need the following configure option
<p>
--with-iconv=/sw/
<p>
and then it should work.
<p>
Hope that helps others, too.
</i>
</quote>
<p>
And, apparently, it does - given the one comment below it so far that has a positive response...
]]></description>
      <pubDate>Fri, 06 Jan 2006 07:23:47 -0600</pubDate>
    </item>
  </channel>
</rss>
