3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = Array( "581095389012"=>Array(21,21,21), "112341234123"=>Array(25,25,25) ); function convertMultiArrayValuesToHistoryInformation($array){ foreach($array as $key=>$value){ echo '<div>Reference number: '.$key; foreach($value as $k=>$v){ echo '<br><span>Product id: getproductname('.$v.')</span>'; } echo '</div>'; } } convertMultiArrayValuesToHistoryInformation($array);
Output for 4.3.0 - 7.1.0
<div>Reference number: 581095389012<br><span>Product id: getproductname(21)</span><br><span>Product id: getproductname(21)</span><br><span>Product id: getproductname(21)</span></div><div>Reference number: 112341234123<br><span>Product id: getproductname(25)</span><br><span>Product id: getproductname(25)</span><br><span>Product id: getproductname(25)</span></div>