N
N
nezzard2017-02-05 19:23:57
PHP
nezzard, 2017-02-05 19:23:57

How to select value from multidimensional array?

Good afternoon, there is an array, I'm trying to select a value from the array inside the loop.
Something like this
$value[0][0]
But nothing happens, you need to get a string with the name at the output, for example director

array(4) { ["director"]=> string(27) "Джеймс Кэмерон" ["writer"]=> string(27) "Джеймс Кэмерон" ["producer"]=> string(73) "Джеймс Кэмерон, Джон Ландау, Брук Бретон" ["artist"]=> string(75) "Рик Картер, Роберт Стромберг, Ник Бассетт" }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kravchenko, 2017-02-05
@evgenyj_kravchenko

echo $value['director']; // will display everything that is nested in it
echo $value['director'][0] // value of the first entry

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question