Jump to content

Recommended Posts

Posted

I tried to write texts from html page into a .txt file using fwrite function. When i checked the .txt file it showing me a bunch of numbers (i dont know what character it is called) instead of latin letters. What should i do so i can get .txt file which contains latin letters?

hope you understand with what im saying in bad english lol

  • 2 weeks later...
Posted

ups yeah i didnt notice it lol.

well im just curious is it possible to do so because i have seen in many php tutorials there was only example of how many times a looping can be done.

sorry if i have mistaken sir, im still learning on php.

 

Posted

Here's a simple example of getting the source of several urls at the same time using the file_get_contents() function and a foreach. The htmlspecialchars() is so that you see the source and not the page.

 

<?php
$url = array(
"http://url.html",
"http://url.html",
"http://url.html");

foreach( $url as $var )
{
$contents = file_get_contents("$var");
$contents = htmlspecialchars("$contents");
echo "$contents<br><br>";
}
?>

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...