In a new posting from the PHPBlog: Dynamically Typed, there's an interesting idea presented - Serializing PHP data structures for Javascript.
"How can this help me?" you ask...well, if you've ever needed to pass information back from PHP to javascript and back again (more than the occasional string), then this posting might be worth a look. The script uses the serialize() functionality of PHP to create the data, then pass it along to the javascript. There is a simple function that he tacks onto the String object in javascript to help in parsing the PHP-serialized string into something it can use.
It's a very simple method to make cross-communication between the two nice and simple. Besides, it just makes it feel cleaner than some other alternatives - or as Harry puts it: "I think PHP and Javascript can be brought much closer together with 'native' serialization - I'm not worried about other languages in this case."




