Reading Serialized PHP Objects from Erlang

Richard Jones - RJ - September 28, 2008

I started writing some Erlang recently. The vast majority of data I need to access from Erlang resides in cached, serialized php objects. Here’s what I came up with to turn a serialized php object into a sort of nested Erlang proplist thing.

<?php


$s = array(123, ‘hello’, 3.14, array(‘a’=>‘foo’, ‘b’=>‘bar’));


print serialize($s);


?>

 

This gives:
a:4:{i:0;i:123;i:1;s:5:"hello";i:2;d:3.14;i:3;a:2:{s:1:"a";s:3:"foo";s:1:"b";s:3:"bar";}}
It’s not hard to [...]



Categories: Blogs  Richard Jones  

Comments

No comments so far, you could be the first.

Add comment

Name:

Email:

URL:

Smileys

Remember my personal information

Notify me of follow-up comments?