Home >Backend Development >PHP Tutorial >PHP uses curl and reports parse error
This code was sent to me by my classmate
<code class="PHP"><?php $ch = curl_init("http://www.baidu.com");//初始化 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $output = curl_exec($ch); curl_close($ch); echo $output; ?> </code>
Exactly the same code, I pasted his code and it ran smoothly, but I typed it by hand and it ran fine
Excuse me, what’s going on? Thank you :-)
This code was sent to me by my classmate
<code class="PHP"><?php $ch = curl_init("http://www.baidu.com");//初始化 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $output = curl_exec($ch); curl_close($ch); echo $output; ?> </code>
Exactly the same code, I pasted his code and it ran smoothly, but I typed it by hand and it ran fine
Excuse me, what’s going on? Thank you :-)
There are hidden characters, I have encountered them too.
The semicolon is missing...