Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1023017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:33:05+00:00 2026-05-16T11:33:05+00:00

how to get all content (HTML Code) of any web page not in my

  • 0

how to get all content (HTML Code) of any web page not in my server by php

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:33:06+00:00Added an answer on May 16, 2026 at 11:33 am

    Two simple methods to print out the content (HTML) of the google.com home-page:

    1. Using file_get_contents()

    <?php
    $content = file_get_contents("http://www.google.com/");
    echo '<pre>'.htmlspecialchars($content).'</pre>';
    ?>
    

    If this method fails (due to URL fopen wrappers not enabled, use second method below).

    1. Using cURL:

    <?php
    function file_get_contents_curl($url)
    {
        $ch = curl_init();
    
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    
        $data = curl_exec($ch);
        curl_close($ch);
    
        return $data;
    }
    
    $content = file_get_contents_curl("http://www.google.com/");
    echo '<pre>'.htmlspecialchars($content).'</pre>';
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get all Books from the server (local PHP script), that
I'm trying to get the content from all the nodes in the bookmarks menu
If I have Model.objects.all() I want to get only one object for any content_object=foo,
I'm using this code for get all news: List<aspnet_News> allNews = context.aspnet_News.OrderByDescending(i => i.NewsId).ToList();
I have a small .get() that receives a block of HTML from a php
I am having trouble fetching content from a web-page, actually i wanted to fetch
I try to setup checkboxes and cannot get working simple code. Any clue? Thank
I'm downloading a web page (tag soup HTML) with XMLHttpRequest and I want to
It is quite easy to load HTML content from your custom URLs/Web services using
I am getting some info from a https web server using PHP plus cURL.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.