3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $hash =[ 'code' => 'valeur', 'foo' => 'bar', 'foo_bar_baz' => 'FOOOOO' ]; $shipping_method = 'code'; foreach ($hash as $code => $label){ if(substr($shipping_method,0, strlen($code)) == $code){ $carrier_code = $code; break; } var_dump($code); } var_dump($carrier_code);