3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = "[orderId] => 212939129; [orderId] => 212939129 [orderNumber] => INV10001 [salesTax] => 1.00 [amount] => 21.00 [terminal] => 5 [currency] => 1 [type] => purchase [avsStreet] => 123 Road [avsZip] => A1A 2B2 [customerCode] => CST1001 [cardId] => 18951828182 [cardHolderName] => John Smith [cardNumber] => 5454545454545454 [cardExpiry] => 1025 [cardCVV] => 100"; $butt = explode(" => ", $data); for ($i = 0; $i < count($butt); $i++) { if ($butt[$i] === "[salesTax]") { echo $butt[$i+1]; } echo $i; } ?>
based on W8eRi
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
012345678910111213141516