|
Sponsored Link
|
I've seen a lot of problems solved with regular expressions, but last Friday, thanks to Chris and Sean, I found out that one can use them to determine whether a given integer is a prime number. The original articles showed the following regular expression:
/^1?$|^(11+?)\1+$/
You don't apply this to the integer itself. Instead, you create a string of repeating 1s, where the numbers of 1s is defined by the number you're testing, and apply the regex to that. If it fails to match, the number is a prime. The...
On the Ibuildings techPortal today they've posted the first episode of their new Dutch PHP Conference 2010 recordings - Ilia Alshaetsky's talk "APC & Memcache the High Performance Duo".APC and Memcache both provide effective mechanism for caching data within PHP applications to improve performance and latency. This talk will cover when to use both of these tools to get the most of your apps and which workflows better suit each tool.You can listen either via the in-page player or you can download the mp3...
I have started seriously using PHP 5.3 recently due to it finally making it into Portage. (Gentoo really isn't full of bleeding edge packages people.) I have used mysqlnd a little here and there in the past, but until it was really coming to my servers I did not put too much time into it.What is mysqlnd?mysqlnd is short for MySQL Native Driver. In short, it is a driver for MySQL for PHP that uses internal functions of the PHP engine rather than using the externally linked libmysqlclient that has been...
Nothing can be said to be certain, except death and taxes. And URL changes.
It's often necessary to reorganize your site and change the URL structure but, assuming you have similar content, users should rarely encounter a a€opage not founda€¯ error. Producing unnecessary 404 pages is one of my top 10 development mistakes.
In this article, we'll create an automated PHP redirection system that converts old URLs to a new address. It's not production code, but it will illustrate the basics so that you can...
This years FrOSCon - one of the most awesome open source software conferences
- is right ahead and we are organizing a PHP track again this year. Read more
for details.
On the KillerPHP blog today there's a new screencast tutorial - part one of a series about form validation with javascript.In this series of video tutorials, we look at Javascript and PHP based form validation by discussing what form validation is, why you should use it and then build an example using PHP and JQuery.You can view the video via the in-page player or check out some of the other great videos from the KillerPHP.com site.
In a new post to his blog today Ilia Alshanetsky talks about a PHP Excel extension to help with some output generation problems he was seeing (based on the LibXL libraries).As we are doing more & more Excel output generation, this became a bigger and bigger problem. At first we've tried solving the problem via a newer PHP based Excel library, PHPExcel. Unfortunately, it is massive beast, that is not only slower than the old Spreadsheet Excel Writer/Reader, but memory hog too. [...] So, I turned to Google...
On the Shift8 blog there's a recent post talking about moving your site away from a CakePHP implementation and towards Lithium with some help from some helpers.I love CakePHP and I love Lithium. I imagine many other people will also love both or one or the other or parts from one or the other or neither or enough already. I also suspect that many people will find themselves moving from CakePHP to Lithium. I believe it will be a somewhat common and natural transition. However, we're missing something. Oh...
On Smashing Magazine today there's a new article from Joost de Valk about some of the things he learned from maintaining a WordPress plugin - one to help easily track your site via Google Analytics.Recently I released a WordPress plugin for Google Analytics that adds a tracking code and dozens of various pieces of meta data to blogs. Since the release of version 4, I've updated it 6 times, to the point where it's now at version 4.0.6. In this article I would like to share with you my experiences in...
In a recent post to his blog Johannes Schluter talks about a new feature that's just been added to the PHP project's trunk - array dereferencing.Now you might wonder what this typical short entry means. when doing OO-style PHP you might make use of a syntax feature which one might call "object dereferencing". [...] So one can chain method calls or property access. Now for a long time people requested the same thing for array offset access. This was often rejected due to uncertainties about memory issues,...
On the Qafoo blog today there's a new article talking about testing the one thing that we as developers can fear the most - legacy code.Today we know about the benefits of Test Driven Development and normally also start new projects using TDD. Most projects from the last couple of years integrated this method in their daily development process, which often results in in good code coverage results of 90% and above. But what about all the other old projects, you still manage in your daily work?They offer...
In a quick post to his blog Luc de Brouwer reminds us that we don't ever need to use $_GET or $_POST directly again thanks to PHP's filter extension.This doesn't just work for $_GET and $_POST but also for $_SERVER and $_COOKIE variables. Check out the documentation for filter_input() on the PHP website.He shows how it compares to the filtering that CodeIgniter has to offer with a few code examples - one showing a filtered fetch and the other showing how to grab the raw value from the superglobal (if you...
If you hang out in one of the many irc channels dedicated to PHP on irc.freenode.net you have probably come across our beloved bot, Phergie. Matthew (Elazar) Turland, bot-wrangler and lead programmer on the Phergie project wrote me to let me know that the latest version of Phergie is now available. Click on in, I've got a quote, a ling and even pieces of the changelog to share with you.
Latest PEAR Releases:
Mail_Mime 1.8.0
File_MARC 0.5.0
File_MARC 0.5.1
OpenID 0.2.1
The ProblemFor a project I need non-guessable synthetic primary keys. I will use them to construct URIs and these URIs need to be non-guessable. If I would use the traditional way of doing so, going the down the route of integer primary keys with auto increments, or using a sequence table an attacker could easily increment or decrement the integer to find some similar items. Next idea was to use UUIDs or GUIDs. These identifiers are globally unique, so this would work for primary keys too. Reading some...
Since I broke my right hand 3 weeks ago while biking, I found myself with a lot of spare time :/. It is amazing just how limited your ability to do things becomes when you can only use one hand. So, to stave off the boredom, I've been slowly toiling away on a PHP Excel extension that I intend to use at work, which I've finally gotten ready for release today.
You can find it on github at: http://github.com/iliaal/php_excel.
Continue reading "PHP Excel Extension"
Finally got around to converting some old code from SVN to Git and getting it up on GitHub. It's like looking back through a time-warp actually, as most of the code hasn't been touched since the summer of 2007.
Nearly all of the code is usable, but it's all abandoned at this point. If there's something there that strikes your fancy and you'd be interested in forking it into your own project, feel free.
There are still a few more to go, but you can start checking them out now at the Domain51 Github...
|
|