Hi all,
Does anyone know if there is a compatible PHP function that will do the same as arrayDecode on a sent string from a livecode program that did an arrayEncode?
I have an LC program that I'd like to send a large amount of arrayed data to a server (not LC based) and receive it via PHP. Serializing the data is the best option for sending it, but I need to do it in a cross platform way and respecting possible UTF8 character sets.
Cheers,
Dave
arrayDecode equivalent in PHP
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Location: Thailand
- Contact:
arrayDecode equivalent in PHP
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
Re: arrayDecode equivalent in PHP
Did you check out the arrayEncode and arrayDecode functions?
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Location: Thailand
- Contact:
Re: arrayDecode equivalent in PHP
Hi,
Uuuum, Yes! Those are the functions that I am using at the Livecode end of the process.
What I'm looking for is if anyone knows something that is at the PHP (server) end that would be able to understand the output from the 'arrayEncode' LC function.
arrayEncode produces a binary serialisation of the array - but it looks like that is something that only LC understands - (unlike the 'serialize' function in PHP which will make a more human-readable JSON-like structure for arrays, etc).
I am basically wondering wether the arrayEncode is going to be any use for cross-language data transfer unless it is using some standard algorithm for the serialisation.
Going with a roll-my-own approach is something I would like to avoid if there is already a solution available in the target (PHP) language.
I hope that helps explain what I am looking for a bit better.
Cheers,
Dave
PS. It would also be nice if there was also an equivalent to the arrayEncode in PHP too - for the reverse route.
Uuuum, Yes! Those are the functions that I am using at the Livecode end of the process.
What I'm looking for is if anyone knows something that is at the PHP (server) end that would be able to understand the output from the 'arrayEncode' LC function.
arrayEncode produces a binary serialisation of the array - but it looks like that is something that only LC understands - (unlike the 'serialize' function in PHP which will make a more human-readable JSON-like structure for arrays, etc).
I am basically wondering wether the arrayEncode is going to be any use for cross-language data transfer unless it is using some standard algorithm for the serialisation.
Going with a roll-my-own approach is something I would like to avoid if there is already a solution available in the target (PHP) language.
I hope that helps explain what I am looking for a bit better.
Cheers,
Dave
PS. It would also be nice if there was also an equivalent to the arrayEncode in PHP too - for the reverse route.
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
Re: arrayDecode equivalent in PHP
It should be pretty easy to duplicate the PHP version of the functions.. Now that the source code for the engine has been released, you can always duplicate what Rev is doing in PHP.. So enjoy the challenge , find if it has already been written (which you are doing), or find someone to write it for you..
-
- VIP Livecode Opensource Backer
- Posts: 253
- Joined: Fri Dec 09, 2011 11:17 am
- Location: Warszawa / Poland
Re: arrayDecode equivalent in PHP
Did you try uniDecode and uniEncode to deal with UTF-8 text data? It's perfect working solution to work with any external text for LiveCode safe for multiplatform.
Marek
Marek