in my vscode I define constant and when i want to print it, vscode gives error and red underline. but it works (prints). I want to remove this error underline but how, i don't know. can you help?
$db['db_host'] = "localhost";
$db['db_user'] = "root";
$db['db_pass'] = "password";
$db['db_name'] = "cms";
foreach ($db as $key => $value) {
define(strtoupper($key), $value);
}
$connection = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
IT works. but VSCODE marks red underline at bottom DB_HOST,DB_USER, DB_PASS, DB_NAME.
I FIX this problem just change code like :
$connection = mysqli_connect(constant("DB_HOST"), constant("DB_USER"), constant("DB_PASS"), constant("DB_NAME"));