This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
alakazard12's profile picture

PHP Serialize Port in Lua

Started by alakazard12, 31 May 2013 - 08:13 AM
alakazard12 #1
Posted 31 May 2013 - 10:13 AM
I was looking around for quite a while trying to find a serialization port for lua. Well, I found one. I just wanted to share it with you guys (Sorry this post isn't very long :P/>)

The link: http://pastebin.com/De0R0CaC

Just incase you didn't know about the Serialization functions in PHP: To use it just use "Serialize(array)" and it will return the serialize table as a string. Then use "Unserialize(string)" and it will return that array.
Lyqyd #2
Posted 31 May 2013 - 10:50 AM
What does this do that textutils.serialize and .unserialize don't do?
PixelToast #3
Posted 31 May 2013 - 10:55 AM
this isnt as good as the default one
ElvishJerricco #4
Posted 01 June 2013 - 04:41 PM
textutils has this. The format of the serialized data is just the lua syntax for creating the same table.
Shazz #5
Posted 02 June 2013 - 08:00 PM
This serializes tables in the same format as PHP's serialize() function (I assume). This means that it is easier to communicate data with HTTP requests.
Orwell #6
Posted 02 June 2013 - 08:16 PM
This serializes tables in the same format as PHP's serialize() function (I assume). This means that it is easier to communicate data with HTTP requests.
That's what JSON is for. :)/> (yes, I know it was made for JS, but it'll do fine in PHP :P/>)
Shazz #7
Posted 02 June 2013 - 10:25 PM
This serializes tables in the same format as PHP's serialize() function (I assume). This means that it is easier to communicate data with HTTP requests.
That's what JSON is for. :)/> (yes, I know it was made for JS, but it'll do fine in PHP :P/>)

Yeah I know, I use JSON all the time (not with Lua but with PHP and Javascript).