Re: Converting an unordered list into JSON

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5 Mar 2012, at 16:02, Jay Blanchard wrote:

> On 3/5/2012 9:53 AM, Stuart Dallas wrote:
>> On 5 Mar 2012, at 15:50, Jay Blanchard wrote:
>> 
>>> I am off on my next tangent now and I have not really thought about this too much yet but have you seen a method to convert a nested unordered list into JSON using PHP?
>> There's a very useful search function for the PHP manual on the PHP site. Typing json into that would have got you to http://php.net/json_encode. If that can't natively handle your variable type then you'll need to massage the data into simple types first.
>> 
> Stuart I have RTFM, I was hoping that someone had an example handy. :)

$json = json_encode($nested_unordered_list);

As I said, whether that works or not depends on what type $nested_unordered_list is. If it's not made of standard types you'll need to massage it into a structure using standard types.

:D

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux