when sending file contents to console SyntaxError: missing ) after argument list [duplicate]

ultimately I am trying to compare a string to the contents of the file but i dont seeb to be able to compare it in php however I was able to compare it in js for a different function but I still had the same problem with printing to consol with the echo statement php.
error:

Uncaught SyntaxError: missing ) after argument list (at search.php:1:21)

code:

<?php
$file = explode('n',file_get_contents("mapPoints.txt"));
if (!$file) {
    echo "<p>Unable to open remote file.n";
    exit;
}
echo "<script>console.log('Debug Objects: " . $file[0] . "' );</script>";
?>

I first tryed file(“mapPoints”) but I had the same result.
I have also tryed printing the file without spliting it.
I am able to compare the file contents to other strings in js but not in php.