arrayDecode equivalent in PHP

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Location: Thailand
Contact:

arrayDecode equivalent in PHP

Post by dave_probertGA6e24 » Fri Apr 12, 2013 7:54 am

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
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: arrayDecode equivalent in PHP

Post by shaosean » Fri Apr 12, 2013 8:17 pm

Did you check out the arrayEncode and arrayDecode functions?

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Location: Thailand
Contact:

Re: arrayDecode equivalent in PHP

Post by dave_probertGA6e24 » Sat Apr 13, 2013 4:43 am

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.
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: arrayDecode equivalent in PHP

Post by shaosean » Sat Apr 13, 2013 7:28 am

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..

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am
Location: Warszawa / Poland

Re: arrayDecode equivalent in PHP

Post by snm » Sat Apr 13, 2013 7:44 am

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

Post Reply

Return to “Internet”