Wednesday, February 3rd, 2010

Yesterday Facebook announced the oncoming release of HipHop for PHP, a PHP to C++ compiler to speed up your PHP application. It's not a new idea to compile a scripting language to a compiler language, but as far as I know, in case of PHP it's the first time anyone has ever tried this. The […]

Thursday, November 19th, 2009

PHP and sessions: Very simple to use, but not as simple to understand as we might want to think. session.gc_maxlifetime This value (default 1440 seconds) defines how long an unused PHP session will be kept alive. For example: A user logs in, browses through your application or web site, for hours, for days. No problem. […]

Friday, November 13th, 2009

Always messed around with a combo of opendir(), readdir(), and closedir() if you wanted to read the contents of a directory? Since PHP 5 there is a new sheriff in town: scandir(): <?php $files=scandir("/etc/php5"); print_r($files); ?> Outputs: Array ( [0] => . [1] => .. [2] => apache2 [3] => conf.d ) Okay, you still […]

Wednesday, November 4th, 2009

My last week blog topic was very much marked by Apache load balancing. Well, I promised to leave this topic alone for a while, but there is one related topic that is worth spending a minute on. The Theory If your web application is distributed across multiple servers you'll quickly run in sessions problems because […]

Thursday, October 22nd, 2009

Yesterday, I started a small tutorial on how to implement typographic headlines with PHP. There were some aspects to be aware of, but in general it was an easy and straight forward process. The final result looked like this: But there was one big issue I had with my script: It was far to slow […]

Wednesday, October 21st, 2009

My recent blog post about scaling images with PHP gave me the idea to write something about creating typographic headlines with PHP. At Apache Friends we're using this technique since many years to get rid of the usual boring and everywhere available "web fonts" like Helvetica, Times and Verdana. For this example I chose the […]

Tuesday, October 20th, 2009

Scaling images in PHP is quite easy, but there are some things to consider. (If you're short of time, right at the end you'll find the final script.) Read the original image with imagecreatefromjpeg() First of all you'll need to read the original image. If it's a JPEG file the imagecreatefromjpeg() function is the right […]

Wednesday, September 30th, 2009

If you're using PHP you're usually don't care how PHP stores variables internally. But if you start working with references you probably better know what's going on behind the scenes. (Without) References Let's assume the following code: $a="Zaphod"; $b=$a; $c=$a; You probably would assume that PHP now keeps the string Zaphod three times in memory. […]

Thursday, September 24th, 2009

I love AWK. It is a wonderful tool for data processing on Unix systems. I truly love it. There is certainly no better tool to process and aggregate log files. I remember back when I introduced AWK to my students, there was always an immediately appreciative murmur in the round when the first AWK scripts […]

Monday, September 14th, 2009

Last weekend Germany's most intellectual elite of PHP ubergeeks came together for two days full of interesting and surprisingly entertaining sessions and discussions. Although it was a very informal and student-friendly event (just drop an eye on the picture above), I was pleasantly surprised by the high level and quality of this event. Yes, events […]

This blog copyright 2010-2012 by Kai 'Oswald' Seidler