Skip to content

Instantly share code, notes, and snippets.

@Restoration
Created August 6, 2016 15:29
Show Gist options
  • Select an option

  • Save Restoration/acc5384f76d59ac3238d0fd62ebc2004 to your computer and use it in GitHub Desktop.

Select an option

Save Restoration/acc5384f76d59ac3238d0fd62ebc2004 to your computer and use it in GitHub Desktop.
PHPにおける定数定義
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<?php
//定数を定義する
define('HELLO','Hello World!!');
echo "定数: HELLO".HELLO. "<br />";
//定数Helloは定義されていないためNoticeエラーが発生します
echo '定数: Hello'.Hello.'<br />';
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment