Jump to content

I need a little coding help


Recommended Posts

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

Link to comment
Share on other sites

  • 2 weeks later...

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>";
}
?>

 

Link to comment
Share on other sites

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...