3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $var[0] = array('Tokyo' => '東京', 'Osaka' => '大阪', 'Fukuoka' => '福岡'); $var[1] = array('Tokyo' => '東京?', 'Osaka' => '大阪?', 'Fukuoka' => '福岡?'); $rental_book_id = array(); foreach($var as $i){ $rental_book_id[] = $i['Osaka']; } var_dump($rental_book_id);
Output for 4.3.0 - 7.1.7
array(2) { [0]=> string(6) "大阪" [1]=> string(7) "大阪?" }