3v4l.org

run code in 300+ PHP versions simultaneously
<?php postLikeStrToArray($str) { $_p = explode('&', $str); $post = []; foreach ($_p as $item) { $parts = explode('=', $item); $key = strtolower($parts[0]); $value = urldecode($parts[1]); $post[$key] = $value; } return $post; } $resp = "MerID=I0110DQX&amp;OrderID=191&amp;ResponseCode=3&amp;ReasonCode=11&amp;ReasonCodeDesc=Invalid+signature&amp;Signature=hHxm7Zd1GeUJz3ZfkloaNG%2BC1hk%3D"; $post = postLikeStrToArray($resp); print_r($post);
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.17
Parse error: syntax error, unexpected '{' in /in/3eff9 on line 3
Process exited with code 255.

preferences:
177.92 ms | 1399 KiB | 53 Q