Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
を実行するprint_rと、次の配列が得られます。
print_r
Array ( [0] => Array ( [id] => 5280 ) )
PHPでid値にアクセスするにはどうすればよいですか?
こんな感じでアクセスできます
$id_value = $your_array[0]['id'];
試す
$mapped = array_map("current",$array); echo $mapped[0];
これは、ルート配列に複数の配列がある場合に便利です。 たとえば:Array(Array(),Array()..)
Array(Array(),Array()..)