3v4l.org

run code in 300+ PHP versions simultaneously
<?php $unflattened_array = [ '["2", "3"]', '["4"]', '["4", "3"]' ]; $flattened_array = []; foreach ($unflattened_array as $items) { array_push($flattened_array, ...json_decode($items)); } $flattened_array = array_unique($flattened_array); var_dump($flattened_array);

preferences:
23.66 ms | 407 KiB | 5 Q