PHP - PHP解析错误:语法错误,意外'mysqli_connect'(T_STRING)[重复]

This question already has an answer here:

I have been trying for the past couple days to establish a connection to a MySQL db. I keep getting this error : PHP Parse error: syntax error, unexpected 'mysqli_connect' (T_STRING). This is all of the code in the script currently. I can't find the reason for the error.

$host = "localhost";
$user = "username";
$pass = "pass";
$db = "database";

$c =  mysqli_connect($host, $user, $pass, $db);

So, the issue was with an invisible Unicode character. I had copy pasted some of the code from another site. Resolved by re-entering manually. Thanks to the person who mentioned this, it looks like their answer was removed. I would have never figured this out. Thanks

</div>

Parse error: syntax error, unexpected T_STRING

usually means you have a bad string somewhere on that line.

Below should help :)

$mysqli = new mysqli($host, $user, $pass, $db);
$connection = ($GLOBALS["___mysqli_ston"] = mysqli_connect($host,  $user,  $pass));
((bool)mysqli_query($GLOBALS["___mysqli_ston"], "USE " . $db)) or die('offline');