Thread: AJAX FTW!!!
View Single Post
Old 08-29-08, 11:56 AM   #16
fivefeet8
Ngemu Mod
 
Join Date: Jul 2003
Location: Fresno, CA
Posts: 1,886
Default Re: AJAX FTW!!!

Quote:
Originally Posted by t3hl33td4rg0n View Post
You're referring to?
Code:
json_encode($array);
Just looked it up, this is gonna make things much easier! For the past few days I've procrastinating and loathing how everything was going to be compiled and parsed back and forth lol!
Yep. That PHP function will encode any array or objects into a JSON string. There was also a php version of the json_encode functions for use in servers which don't have the newest version of PHP installed, but it was far far slower than the C extension. Remember though, that the JSON encoding will only encode data, not functions. Functions do not get encoded back into Javascript object functions.

Also, json_encode will only encode public object variables. Any object variable that is not public will be left out of the encoding.
__________________
[i7 2600k @4.4ghertz][2x4 GB DDR3 1600][EVGA GTX570 1.280GB SC][EVGA GTX460 physx][Asrock Extreme7 Gen3 Z68][2xSeagate 160 Gb SATA HD raid0][Seagate 250 GB SATA2 HD][Sony Bravia 40' 1080p LCD HDTV][NEC 3520a DVD+-DLw][Windows 7 Ultimate x64][Rosewill 1000w]
fivefeet8 is offline   Reply With Quote