LoginSignup
1
0

PHPのヒアドキュメントでVSCodeのシンタックスハイライト(色付け)

Last updated at Posted at 2023-06-28

ヒアドキュメントに言語を指定する事によりシンタックスハイライト(色付け)してくれる

html

$html = <<<HTML
<div>
    <p>hello world</p>
</div>
HTML;

echo $html;

JavaScript

function shortcode_aaa(){
$contents = <<<JS
    <script>
        $(() =>{
            console.log('hello world');
        });
    </script>
JS;
return $contents;
}

SQL

$sql = <<<SQL
    SELECT id,name
    FROM M_table_data
    WHERE id = ?
SQL;
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0