3v4l.org

run code in 500+ PHP versions simultaneously
<?php $records = [ [ "id" => 8, "username" => "macq", "owner" => [ [ "id" => 5, "name" => "Hyna Bora", "adress" => "ul.Baranio 17,34-567 Zadupie", "property" => [ [ "id" => 6, "name" => "Garaż", "adress" => "ul.Baranio 17,34-567 Zadupie", ] ], ], [ "id" => 6, "name" => "Kasia Doryghi", "adress" => "ul.Hellera 18,94-537 Katowice", "property" => [ [ "id" => 7, "name" => "Mieszkanie", "adress" => "ul.Hellera 18,94-537 Katowice", ] ] ] ] ] ]; foreach($records as $record){ foreach($record['owner'] as $recordowner){ if(array_key_exists("property", $recordowner)){ $Owner_names = array_column($recordowner['property'], 'name'); print_r($Owner_names); } } }
Output for rfc.property-hooks, git.master, git.master_jit
Array ( [0] => Garaż ) Array ( [0] => Mieszkanie )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
42.76 ms | 1589 KiB | 4 Q