Hello, World. I have something I’d like to do in PHP using the file_get_contents() method in php7. So, below you’ll see some php code that I need to use with the new function. Thanks for helping in advance…
$a[] = "foo";
// get the q parameter from URL
$q = $_GET["user"];
$hint = "";
// lookup all hints from array if $q is different from ""
if ($q !== "") {
$q = strtolower($q);
$len=strlen($q);
foreach($a as $name) {
if (stristr($q, substr($name, 0, $len))) {
if ($hint === "") {
$hint = $name;
} else {
$hint .= ", $name";
}
}
}
}
So, you see that up there you have $a[] = "foo";
. This will echo “foo” if the GET parameter is equal to “f” or “fo” or “foo”.
So, instead of $a[] = "foo";
I want to make it read the document “comm_names.txt” line for line, then render that in the php script so it will automatically do the $a[] =
with automatically inserting data retrieved from “comm_names.txt”.
If you need a more detailed description, or whatever, please don’t hesitate to ask me :D. Again, thanks in advance!