You've got a couple of problems... first one being here:
if(!isset($filegets) or $filegets == 'FALSE')
Here, you're checking if $filegets is set, even though you just declared it on the previous line. In other words, using isset() is pointless here and you should simply remove it.
Second problem with that if() statement is that you're comparing $filegets to the string 'FALSE' (the literal word 'false') and not the boolean FALSE you should be checking for. Boolean TRUE and FALSE keywords aren't surrounded in quotes (which are used to delimit strings).
You have this same problem in the next if() statement as well, in addition to another problem:
if(!isset($fileread) or $fileread='FLASE')
Again, the use of isset() is superfluous since the variable was just declared on the line before that if() statement (you might as well be checking that 1+1==2 and 2*2==4), but you also used the assignment operator rather than the comparison operator when checking the $fileread variable.
Last, another problem you'll observe once you fix the above errors is here:
echo "$matches";
$matches is an [man]array[/man], so trying to use [man]echo[/man] on it will yield you nothing but the word "Array".