Is there some type of limitation for the array functions you can use on file() ?
According the the manual, using [man]file()[/man] (with the syntax file("pagetoparse.ext"), where "ext" is the extension of the file) will parse each line of a file into an array element.
eg...
If file.html contains:
<html>
<body>
TEXT
</body>
</html>
and document.php contains:
<?php
$parsefile = file("file.html");
$find_key = array_search("TEXT", $parsefile);
echo $find_key;
?>
In theory, this should return "2", right? Wrong! There's nothing wrong, that I can tell, with the array_search() function, because it seems to work fine on any array that is declared within the document (as opposed to one created by the file() funcion).
Am I doing something wrong, here, or might it have something to do with the version of PHP I am using (4.1.2), or something else....?
Any help would be appreciated🙂