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

Thanks, for the solution above.

One more thing, if i have a function() and i want it to loop for 5 minutes how should i write the php code using 'for loop'.

Thanks in advance.

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

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...