docs

Using XML In PHP5

Everybody likes documentation. The Zend folks posted this overview and SimpleXML introduction The O’Reilly folks at ONLamp offered this guide to using SimpleXML. Of course, there’s always the SimpleXML docs at PHP.net.

Two problems: I haven’t encountered CDATA in my XML yet, but I do hope to develop a better solution than offered here when I do. The other is that SimpleXML chokes on illegal characters, a unfortunately common occurrence in documents coming from III’s XML Server.

Doing Relevance Ranked Full-Text Searches In MySQL

I’m going out on a limb to say MySQL’s full-text indexing and searching features are underused. They appeared in MySQL 3.23.23 (most people are using 4.x, and 5 is in development), but it’s been news to most of the people I know.

Here’s the deal, the MATCH() function can search a full-text index for a string of text (one or more words) and return relevance-ranked results. It’s at the core of the list of related links at the bottom of every post here.

For that query, I put all the tag names into a single variable that might look like this:

$keywords = “mysql database php select full-text search full-text searching docs documentation”

Then I do a select that looks something like this:

SELECT * FROM wp_posts WHERE MATCH(post_title,post_content) AGAINST(‘$keywords’);

The docs give a lot more detail, including how to do boolean searches.

Enabling .htaccess On Mac OS X

I do a lot of web development on my laptop. I’ve got Apache and PHP there, so it’s really convenient, but I usually move projects off to other server before I get around to wanting to mess with mod_rewrite. Not so, recently, but I ran into a big stumbling block when I discovered OS X’s […] » about 200 words

PHP Developer Resources

Somebody asked for some links to get started with PHP. Of course I lead them to the PHP.net official site, where the documentation is some of the best I’ve seen for any product.

I also suggested PHPDeveloper.org and PHPFreaks.com, though the truth is I usually Google any questions I have that the official docs don’t answer. Still, I’ve found some good info at both of those.

Finally, the PHP Cheat Sheet at ILoveJackDaniels.com is pretty nice to have around (cheat sheets mentioned previously).