'err', 'error' => "$errstr ($errno)" ); } // close the socket connection: fclose($fp); // split the result header from the content $result = explode("\r\n\r\n", $result, 2); $header = isset($result[0]) ? $result[0] : ''; $content = isset($result[1]) ? $result[1] : ''; // return as structured array: return array( 'status' => 'ok', 'header' => $header, 'content' => $content ); } $ary_data = array(); $name ='YYY';$email='YYY@YYY.com'; $ary_data['data'] = base64_encode('event=2017datascitw&name='.$name.'&email='.$email); $ary_data['api'] = base64_encode('ip.php'); $ary = post_request('http://140.109.22.22/di3.vcloud.iis.sinica.edu.tw_proxy.php', $ary_data); print_r($ary); foreach($ary as$k=>$v){ echo'

'.$k.'

'; var_dump($v); }