3v4l.org

run code in 300+ PHP versions simultaneously
<?php $upsells = ['Наименование товара №1_~-250$_~-99$', 'Наименование товара №2_~-699$_~-399$', 'Наименование товара №3_~-299$_~-149$',]; $orderDetails = ['Наименование', 'Старая цена', 'Новая цена']; $text = ''; foreach ($upsells as $upsell) { $productInformation = explode('_~-', $upsell); for ($i = 0; $i < count($productInformation); $i++) { $text .= '<b>'.$orderDetails[$i].':</b> '.$productInformation[$i].'<br />'; } } echo $text;
Output for git.master, git.master_jit, rfc.property-hooks
<b>Наименование:</b> Наименование товара №1<br /><b>Старая цена:</b> 250$<br /><b>Новая цена:</b> 99$<br /><b>Наименование:</b> Наименование товара №2<br /><b>Старая цена:</b> 699$<br /><b>Новая цена:</b> 399$<br /><b>Наименование:</b> Наименование товара №3<br /><b>Старая цена:</b> 299$<br /><b>Новая цена:</b> 149$<br />

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:
116.51 ms | 1580 KiB | 4 Q