Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

array and objects

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

array and objects

Postby rideanridean » Mon Jan 13, 2014 7:38 am

hi there!

i'm pretty new to PHP programing and now i got this problem with a complex array named data_cell:

Array (
[date] => 1389312000
[events] => Array (
[1389348000] => EM_Event Object (
[event_id] => 1
[post_id] => 599
[event_slug] => ...

i need the code to get the "post_id" value... can you please help me?!?

thank you!
rideanridean
New php-forum User
New php-forum User
 
Posts: 1
Joined: Mon Jan 13, 2014 7:22 am

Re: array and objects

Postby MarioParty » Sat Feb 08, 2014 10:36 am

Code: Select all

$array 
= array(); // Store the array in question in this variable
$post_id = $array['events']['1389348000']->post_id// 599
 
MarioParty
New php-forum User
New php-forum User
 
Posts: 42
Joined: Tue Aug 02, 2011 2:52 am


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.