PHP Code file_get_contents - Php

How to get the contents of a website using PHP code?

Snippet Code


  
Rate this page :
  [ 0 votes]

The PHP file_get_contents function is used to read files into a string. Here, the below code can be used to get html contents from "hscripts.com" website using file_get_contents().

<?php $homepage = file_get_contents('http://www.hscripts.com/'); echo $homepage; ?>

Tags


Ask Questions

Ask Question