Jump to content

[SOLVED] put in array list the content of an other webpage


snk

Recommended Posts

When I run the below code

 

$str=file_get_contents("http://www.test.com/sub/notes.html",FALSE,1024);
echo $str;

 

i receive a warning

Warning: file_get_contents() expects at most 2 parameters, 3 given......

 

and it doesnt echoes the $srt

Can somebody helps?

<?php
$search_criteria = "help";
  $str = file_get_contents("http://www.dcs.napier.ac.uk/~cs170/32037lnotes.html");
  $word = explode(" ",$str);
   for (i=0; i< sizeof($word); i++)
  {
  	if ($word[i] == $search_criteria){
?> <span class="style1"><?php echo $word[i]; ?></span> <?php 
i=i++;
$size++;
}
echo $word[i];
  }
?>

 

I get a blank page, and it looks so perfect... :( can somebody confirm that  for (i=0; i< sizeof($word); i++) is valid code?

 

thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.