(preg_match("/$link=*/i",$line)
well if you are trying to match $link against &link .... You'll be ther for a long time.
$line = "hello how are you doing";
if(!preg_match("/how/", $line))
{
echo "nope";
}
whatever is between the / and the / has to match perfectly otherwise will return false.
There are quite a few characters that may have to be escaped in a preg_match. I think $ is one of them.