showMsg('img required'); exit; } $image_array = getimagesize($img); print_r($image_array); } public function actionC($url){ if(!$url) { $this->showMsg('url required'); exit; } $curl = @curl_init(); if ($curl) { curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); curl_setopt($curl, CURLOPT_TIMEOUT, 3); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_POST, 0); curl_setopt($curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', )); $response = curl_exec($curl); curl_close($curl); } print_r($response); } /** * 显示信息 * @param $status * @param $msg */ protected function showMsg($msg) { echo $msg . PHP_EOL; } }