PHP Object Array to JSON format Array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
manpakhong
Forum Newbie
Posts: 1
Joined: Thu Feb 16, 2012 7:53 am

PHP Object Array to JSON format Array

Post 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
jraede
Forum Contributor
Posts: 254
Joined: Tue Feb 16, 2010 5:39 pm

Re: PHP Object Array to JSON format Array

Post by jraede »

Post Reply