Here is a simple code to get a content of URL (HTML file) and put it into a variable/string. This is useful for content grabbing, for example.
< ?php
function getContentOfURL($url){
$file = fopen($url, "r");
if($file){
while (!feof ($file)) {
$line .= fread ($file, 1024*50);
}
return $line;
}
}
?>
Usage:
< ?php
$string = getContentOfURL("https://sitename.com/index.htm");
?>
yeah, as easy as that ^_*
andiwijaya
Dengan code diatas apakah halaman web yang dimakasud bisa di grab semua berikut gambarnya ? bagaimana jika kita hanya ingin menampilkan contentnya saja dihalaman website kita, sehingga tidak akan merubah tampilan desain.
simao
Hi, this method is very easy.But the url requested can’t be with the same session.
sory, my english is poor.:)