Page 1 of 1

PHP Object Array to JSON format Array

Posted: Thu Feb 16, 2012 7:55 am
by manpakhong
Dear experts,

Any function can I use to convert from php object Array to Json format array?

Thanks for all kind reply.

Code: Select all

2012-02-16 10:07:02***LOG_TYPE_MESSAGE_INFO*** Object Array
total records: 1
Array
(
[0] => Album Object
(
[sid:protected] => -1
[seq:protected] => -1
[title:protected] => a
[subtitle:protected] => d
[description:protected] => c
[albumDate:protected] => 2012-02-29T16:00:00.000Z
[coverPicFile:protected] =>
[updatedBy:protected] =>
[lastUpdate:protected] =>
[remarks:protected] =>
)

)


-----------------------------------------------------------------------------------------
2012-02-16 10:07:02***LOG_TYPE_MESSAGE_INFO*** Json format array

total records: 1
Array
(
[albums] => Array
(
[0] => Array
(
[sid] => -1
[seq] => -1
[title] => a
[subtitle] => d
[description] => c
[albumDate] => 2012-02-29T16:00:00.000Z
[updatedBy] =>
[lastUpdated] => 2012-02-16T10:07:02.527Z
[remarks] =>
)

)

)
Regards,
Man Pak Hong , Dave

manpakhong@hotmail.com

manpakhong

Re: PHP Object Array to JSON format Array

Posted: Fri Feb 17, 2012 5:13 am
by jraede