Link to home
Start Free TrialLog in
Avatar of jagguy
jagguyFlag for Australia

asked on

display values from array

Hi, In php how do I extract the values  if id ?
$data is the whole array

    foreach (  $data as $key => $item) :
                       
                        //   echo $data['tutor_del'][$key]['id'];???????/
                          echo [$key]$item['id'];???????
                     
                      endforeach;


array(
	(int) 0 => array(
		'id' => '13'
	),
	(int) 1 => array(
		'id' => '0'
	)
)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Brian Tao
Brian Tao
Flag of Taiwan, Province of China image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Let's make sure we are using the correct data structure (the data is much more important than the code when you're asking a question here at E-E).  Please use var_dump() to print out the contents of $data and post that here.  Once we see your data, we can usually set up a tested-and-working code sample for you.

If you need to understand PHP arrays, these links may help.
http://php.net/manual/en/book.array.php
Avatar of jagguy

ASKER

 

here is the array, how do i the valu of id?
previous example didnt work
array(
	(int) 0 => array(
		'id' => '13'
	),
	(int) 1 => array(
		'id' => '0'
	)
)

Open in new window