Classes in PHP and JSON

I started looking into classes in PHP and found a great way to encapsulate a lot of logic that I am going to use quite often for my grids. In addition, I found a method in PHP that also converts objects into JavaScript Object Notation (JSON) – json_encode($this). It takes a lot of the manual labor out of the equation. PHP’s implementation appears to be a little bit more heavier on the encoding and casts property names to strings. I found one problem where I had to recast integers retrieved from a database so that the JSON would represent them as numbers instead of strings.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]

Comments are closed.

%d bloggers like this: