5

I have a system that combines the best and worst of Java and PHP. I am trying to migrate a component that was once written in PHP into a Java One.

Does anyone have some tips for how I can parse a PHP serialized datastructure in Java? By serialized I mean output from php's serialize function.

1
  • 2
    Alternatively you could modify the PHP to let is serialize to a cross-platform format like JSON, or XML if you want to be fancy. Commented Jul 2, 2010 at 9:31

2 Answers 2

3

PHP serializes to a simple text-based format. PHPSerialize looks like a parser written in Java. You can also port the Python implementation to Java -- I doubt it's very complex.

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect a library. You're right it's not complex, just didn't want to reinvent the wheel if I didn't have to. thanks.
3

I had the same issue and found this library: http://code.google.com/p/serialized-php-parser/

It does exactly what you need

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.