Page 1 of 1

Warning: Bad arguments to implode()

Posted: Mon Apr 22, 2002 4:30 am
by edexly25
hi all,

i need help fast.

the sportsnews script i have gives me this error;

Warning: file("http://www.sport4ever.net") - Success in /home/banner/public_html/sports.php on line 6

Warning: Bad arguments to implode() in /home/banner/public_html/sports.php on line 6

heres the script;

<?
$url = "http://www.sport4ever.net";
$target="_blank"; // (_balnk) to open in new window - () to open in the same window
$string = implode("
", file($url));
$string2 = explode("<!-- NP v3.7.5 -->", $string);
$string3 = explode("</td></tr></table>", $string2[1]);
$news = str_replace('href="news-world.shtml"',"href="$url/news-world.shtml" target="$target"".$url,$string3[0]);
echo "<span dir=rtl>".$news."</span>";
?>

thanks :)


ed

Posted: Mon Apr 22, 2002 6:39 am
by jason
Make sure file() is actually returning something. You don't verify that it is. Capture its return value in a variable, and print_r() to see if you get something back.

Also, verify with is_array().