我想在我的网站上显示一个数据,该数据来自其他网站[关闭]

I am very new to this code world but I am really interested. Now I'm having a problem.

My Problems begins here-

This is an example. Imagine that I need a data form this website [Picture below]

The Data I want form the website

You saw that there is Total Clicks: #Number#

Now I want this Total Click: #Number# in my index.html which is located in my computer. Like this below [See Picture]

What I really want

Please tell me is it possible. If yes please tell me the code should I use in it.

Thank you very much..

yes you can fetch data from another website using cURL, please see example code where i'm fetch first complete webpage of another website and after that i'm find text into H1 HTML text.

<?php
// Defining the basic cURL function
function curl($url) {
    $ch = curl_init();  // Initialising cURL
    curl_setopt($ch, CURLOPT_URL, $url);    // Setting cURL's URL option with the $url variable passed into the function
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Setting cURL's option to return the webpage data
    $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable
    curl_close($ch);    // Closing cURL
    return $data;   // Returning the data from the function
}
function getTextBetweenTags($string, $tagname) 
{
    $pattern = "/<$tagname ?.*>(.*)<\/$tagname>/";
    preg_match($pattern, $string, $matches);
    return $matches[1];
}
$scraped_website = curl("http://www.example.com");
echo getTextBetweenTags($scraped_website,'h1');
?>

Hope this will worked for you.

In reference to the above (apparently correct ...) answer, also note that the end-user of your web site will not receive any HTML response until your web-server receives its response from the remote. If you can be reasonably assured that this will happen quickly, then there's no problem. But, if it might take a little time, there are a couple of things you might wish to do. (Users are notorious for being "trigger happy.")

First, you can "push" some initial HTML output to the user's screen ... dunno, a little JavaScript progress-bar thingy ... both to entertain him and to let him know to wait. Then, replace that content with the real reply once you can get it.

Second, and only if security and other factors permit of such things, you can devise your site so that the client requests the additional information by means of an AJAX-call.