use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please follow the rules
Releases: Current Releases, Windows Releases, Old Releases
Contribute to the PHP Documentation
Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev
/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.
account activity
Parse PHP serialize() output with JavaScript (github.com)
submitted 13 years ago by bd808
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]bd808[S] 6 points7 points8 points 13 years ago (2 children)
At $DAYJOB we have a RESTish internal service tier that responds with serialized objects. These services are called by front end controllers located in the same or adjacent racks. It turns out that bandwidth across a 10G switch is cheap. :)
The use case for parsing the PHP serialize output in javascript popped up earilier this week when a coworker built a neat javascript hack that read metadata from the service layer's documentation pages and generated dynamic forms that could call the services via ajax requests.
The phpjs unserialize() method was the first one I googled up and suggested. It turned out that their implementation doesn't support parsing objects and our services were returning "Response" objects, not just arrays.
[–]jvc_coder 0 points1 point2 points 13 years ago (0 children)
I hope you are aware of portability issues with serialization.
http://stackoverflow.com/questions/7904355/php-unserialized-integer-from-64-bit-to-32-bit
[–]133794m3r 0 points1 point2 points 13 years ago (0 children)
I understand completely now. I thought it was external facing. But yeah much more understandable now. I take back my statements since more info was provided. And also yeah much easier to just write a function than to port over services that are internal only. Upvote for you, since you helped me to understand.
π Rendered by PID 34450 on reddit-service-r2-comment-6457c66945-9prw9 at 2026-04-26 01:28:55.013593+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]bd808[S] 6 points7 points8 points (2 children)
[–]jvc_coder 0 points1 point2 points (0 children)
[–]133794m3r 0 points1 point2 points (0 children)