3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encodePost(array $post, $print=false){ $_post_string = array(); foreach($post as $key=>$value){ if(!is_array($value)){ $_post_string[] = $key."=".urlencode($value); }else{ foreach($value as $k=>$v){ $_post_string[] = $key."[]=".urlencode($v); } } } $_post_string = implode("&",$_post_string); if($print){ echo "<br/>".$_post_string."<br/>"; } return $_post_string; } $post = [ 'hash' => '62d417c8554711d322887588ed8ab3dd4636c8d5', 'product' => PROD_LITIGANT_ALERT_NAME, 'hits' => 20, 'rows' => 1000, 'billable_rows' => 850, 'errors' => [ '567 - Unknown zipcode [ignoring]', '23 - Invalid radius format [using default]', '150 - Data does not match header count, 1 extra columns [not searching]' ], 'submitted' => '2018-04-25 15:24:32', 'completed' => '2018-04-25 16:01:12' ]; encodePost($post, true);

preferences:
63.2 ms | 402 KiB | 5 Q