Hmm, there is something that I don't understand about preg_match_all(), and I'm not sure what it is.
I get this when I run my code:
Fatal error: Only variables can be passed by reference in c:\program files\apache group\apache\htdocs\boxscorefetcher.php on line 12
And here is my code:
<html>
<head><title></title></head>
<body>
<?php
$fd = fopen ("c:\WINDOWS\Desktop\scoreboard[1].txt","r");
$boxscoreURLs = array();
$pattern = "boxscore.html";
while (!feof ($fd)) {
$buffer = fgets($fd, 4096);
$URLs = preg_match_all ("$pattern", "$buffer", "$boxscoreURLs", PREG_PATTERN_ORDER);
echo ("$buffer");
echo ("$URLs");
}
?>
</body>
</html>
In case there is confusion with the word wrap, this is line 12:
$URLs = preg_match_all ("$pattern", "$buffer", "$boxscoreURLs", PREG_PATTERN_ORDER);
If it can't be figured out by my code, I want to match "boxscore.html" within the file I opened and stored in $buffer, and then I want all of those matches to be stored in the array, $URLs.
why doesn't this work? Also, if someone sees some extraneous code, would you also tell me?
Thanks