LoginSignup
1
0

More than 5 years have passed since last update.

PHPでURL指定して内容をもってくる関数[file_get_contents]サンプル

Posted at

Amazonの公式サイトの内容をとってくるサンプルです。

PHP
<?php

  $file="https://www.amazon.co.jp/";
  $json=file_get_contents($file,false,stream_context_create());
  echo $json;

?>

そのまますべて取ってくることができます。
正規表現と組み合わせると、画像だけ取得するなんてこともできます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0