Simon Willison’s Weblog

Subscribe

Items tagged php in 2003

Filters: Year: 2003 × php × Sorted by date


An apology

It turns out that the Javascript on PHP.net mentioned previously was not deliberately obfuscated to protect the code from prying eyes; it was merely compressed to reduce the size of the script. See this comment for further details. I’d like to apologise to the maintainers of PHP.net for jumping the gun on this issue. Incidentally, the unobfuscated code is now available in CVS.

[... 72 words]

The good and the ugly

PHP.net has a new feature on their search page—a really nice implementation of an auto complete text widget in Javascript. Even better, the search page is valid XHTML 1.0 Strict and uses CSS for the layout. Let’s hope this is an indication of things to the come for the rest of the site, which still mostly consists of tag soup.

[... 368 words]

PHP Library Tips

Kellan Elliott-McCrea (author of the popular Magpie RSS parser): A Few Tips for Writing Useful Libraries in PHP. Kellan makes the interesting observation that PHP encourages a culture in which most development occurs in the context of either full applications or C extensions, with few people devoting themselves to releasing libraries.

[... 56 words]

PHP philosophy, and bundling SQLite

Here’s a great quote from Rasmus Lerdorf (the creator of PHP) for people who have become disheartened with PHP’s lack of elegance when compared to other languages such as Python:

[... 232 words]

Supporting Conditional GET in PHP

This site’s RSS feeds now support Conditional GET. Since the feeds are dynamically generated on every request, adding support took a bit of hacking around with PHP. Here’s the function I came up with (based on the excellent description provided by Charles Miller in the article linked above):

[... 398 words]

Verbose Regular Expressions

Ned Batchelder describes Verbose Python regular expressions. This is one of the things I’ve known about (as in known that they exist) for ages but have never got around to using. I’ve been working with some pretty heavy regular expressions recently that could really do with the clarity of being defined in verbose format with comments.

[... 96 words]

Hashing client-side data

Via Scott, a clever PHP technique for ensuring data sent to the browser as a cookie or hidden form variable isn’t tampered with by the user:

[... 248 words]