崇高なテキスト 2 で次のスニペットを作成しましたが、それを PHP スクリプト内で使用すると、すべての変数 (値ではない) が自動的に削除されます。
<snippet>
<content><![CDATA[
include 'constants.php';
// Defining connection
$connection = mysqli_connect(HOST, USERNAME, PASSWORD);
// If unable to connect
if(!$connection)
{
$error = 'Unable to connect to database server';
echo $error;
exit();
}
// Checking the encoding
if(!mysqli_set_charset($connection, 'utf8'))
{
$error = 'Unable to set database connection decoding';
echo $error;
exit();
}
// Selecting Database
if (!mysqli_select_db($connection, DATABASE))
{
$error = 'Unable to locate the .'. DATABASE;
echo $error;
exit();
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>phpMysqlConnection</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.php</scope> -->
</snippet>
本当に何が起こっているのですか?