Home > Backend Development > PHP Tutorial > PHP uses curl and reports parse error

PHP uses curl and reports parse error

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-25 10:37:14
Original
1418 people have browsed it

This code was sent to me by my classmate

<?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;
?>
Copy after login
Copy after login

PHP uses curl and reports parse error

Exactly the same code, I pasted his code and it ran smoothly, but I typed it by hand and it ran fine

PHP uses curl and reports parse error

Excuse me, what’s going on? Thank you :-)

Reply content:

This code was sent to me by my classmate

<?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;
?>
Copy after login
Copy after login

PHP uses curl and reports parse error

Exactly the same code, I pasted his code and it ran smoothly, but I typed it by hand and it ran fine

PHP uses curl and reports parse error

Excuse me, what’s going on? Thank you :-)

There are hidden characters, I have encountered them too.

The semicolon is missing...

Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template