Older Twocentsworth.com Archives

Sillyness

OO PHP - safeHTMLCheck

Simon Willison posted a pretty cool piece of object oriented PHP yesterday. It takes a string of HTML and makes sure it validates XHTML, doesn’t have any presentational markup or attributes, and is considered “safe”.

It looks like he might still be working out some of the bugs, but for a first go around, with those design goals in mind, I’d say it’s a great first step.

I was particularly interested to see an example of object oriented PHP since that is what I’ve spent my entire weekend doing. I decided to dive right into PHP by creating several classes and a library of code that will be useful for future use.

I feel like I’ve absorbed a ton of PHP knowledge over the weekend. I really like some of the things that I can do, that are impossible with ASP. Things like controlling the output buffers and class inheritence make a big difference. The tight integration between PHP and mySQL certainly helps too.

I hope to post some of my class libraries soon, but I need to finish some things and test them a little more thoughly first. I don’t know if anyone would even want this stuff. It’s pretty basic database abstraction and page templating stuff. Most people probably use PEAR and SMARTY for that, but I wanted something smaller, something I could call my own.

Originally published on OO PHP - safeHTMLCheck'">Monday February 24, 2003 at 2:12 am

Comments were disabled for this post. This happens for a variety of reasons and most likely it's not your fault. Unless you're a spammer. Then it might be your fault.