RSS2JSON

By Albert on November 19, 2010 7:54 PM

The other day I was about to integrate an RSS feed onto a web page using jQuery.

To ease the way in which jQuery accessed the feed, I decided to write a quick fopen proxy, and then I figured… hey, why not convert this to JSON while I’m at it?

I did a quick search for “convert rss to json with php”, and turned up a bunch of stuff that wasn’t what I was looking for. So I opted out of the lazy web approach and decided to think for a moment… aha, this is much easier!

$json = json_encode(simplexml_load_string($rss));

Wow. Who says you can’t do useful stuff with PHP in one single line??

PHP Sockets?

By Albert on September 12, 2010 12:50 PM

I just posted this to StackOverflow in response to a question about PHP sockets:

Actually it is my experience that PHP5 sockets are quite good. They are written in C and built-in to the PHP5 binary, so they would run quickly, as opposed to being implemented in PHP itself.

Check out nanoweb and nanoserv:

http://nanoweb.si.kz/

http://nanoserv.si.kz/

The author has done an impressive job of putting PHP sockets to work, building a highly capable pure-PHP webserver with nanoweb, and a complete server daemon framework for PHP 5.1+ with nanoserv.

Looking through the nanoserv documentation and code base may give you more confidence in PHP sockets.

Nexista and PBooks Now @ Github!

By Albert on July 9, 2010 1:57 PM

Just spreading the good news - the two PHP projects I work on the most, Nexista (a web application development framework) and PBooks (an open source accounting web app) are now hosted at Github.

In the process, I went through PBooks and made sure the code is totally up-to-date. I've still got some organizing to do, but its a big step forward.

In the several months I've been using Git, I'm really amazed by how useful it is!

Fitzgerald: A PHP Framework Inspired by Sinatra

By Albert on February 12, 2010 8:59 PM

I'm glad to see another Sinatra port! This time to PHP, which is good, because PHP has really good Ming support.

I've cloned the tree to Docunext Mirrors:

Simple PHP Example

By Albert on September 1, 2009 3:14 PM
<?php

echo "Hello World!";

?>

Categories