Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unserialize in Java a serialized php object

Does anyone know if it is possible, actually if it has been done, to serialize an object in php and unserialize it in Java (java-php communication). Maybe an adapter will be needed.

What do you think?

Thanks

like image 892
Hypnus Avatar asked Apr 13 '09 09:04

Hypnus


1 Answers

There is serialized-php-parser, which is a Java implementation that can parse php-serialized objects. In general, if you have the choice, I wouldn't recommend php-serialized as an exchange format, because it isn't ascii-safe (It contains null-bytes). Go with a format like xml or json instead. If you need a bit of type-information, xmlrpc is a good choice. It has good implementations for both php and Java.

like image 165
troelskn Avatar answered Oct 20 '22 08:10

troelskn