Using PHP, parsing error occurs when curl initializes

WBOY
Release: 2016-08-26 10:12:58
Original
958 people have browsed it

$arr = array(

0 => 'first', 
1 => 'second',
2 => 'third'
);

echo json_encode($arr);
echo "
";
echo 1234;
phpinfo();
?>

 $ch = curl_init();//Initialization
// curl_setopt($ch, CURLOPT_URL, "http://localhost/info.php?type=json");//Settings Options, including URL
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($ch, CURLOPT_HEADER, 0);
   //Execute and obtain the HTML document content
  $output = curl_exec($ch);
  //Release curl Handle
 curl_close($ch);
  //Print the obtained data
 print_r($output);
?>

Using PHP, parsing error occurs when curl initializes

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template