添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
深情的火腿肠  ·  通俗易懂 ...·  1 年前    · 
愉快的猴子  ·  C++ 指针数组 | 菜鸟教程·  2 年前    · 
空虚的显示器  ·  PostgreSQL ...·  2 年前    · 
留胡子的红薯  ·  【SpringBoot ...·  2 年前    · 
  1. Make sure that the server has a valid SSL certificate installed.
  2. Make sure that your version of PHP is compiled with the --with-curl option, as file_get_contents() can sometimes use cURL for HTTPS requests if it is available.
  3. Try specifying the ssl stream context option when calling file_get_contents() , like this:
$context = stream_context_create ( $options ); $url = 'https://jsonplaceholder.typicode.com/posts/1' ; $response = file_get_contents ( $url , false , $context ); $data = json_decode ( $response , true ); echo 'Title: ' . $data [ 'title' ] . PHP_EOL; echo 'Body: ' . $data [ 'body' ] . PHP_EOL; Try it Yourself » How can I prevent SQL injection in PHP? How do I get a YouTube video thumbnail from the YouTube API? Alternative to file_get_contents?