-1

I have a multidimensional array:

Array ( [0] => Array ( [id] => 21 ) )

I need it to be convert it to a string to echo it out and to use it as a variable. How can I do that? I need only the id.

I was trying to use implode('', $this_array); , adding (string) before this array, but does not help...

Jay
  • 57
  • 3
  • 9

1 Answers1

0

You can do -

$id = $this_array[0]['id'];
echo $id;
Sougata Bose
  • 31,517
  • 8
  • 49
  • 87
  • Oh, thank you a lot. I am just not good in arrays, especially multidimensional, so I have tried more complex variants – Jay Jul 29 '15 at 06:19