Created
August 6, 2016 15:32
-
-
Save Restoration/3ec17ff291d17d3b48860912aadf853e to your computer and use it in GitHub Desktop.
文字列の出力
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE> | |
| <html lang="ja"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| </head> | |
| <body> | |
| <?php | |
| //変数に文字列を代入 | |
| $name = "hoge"; | |
| $Name = "hogehoge"; | |
| //大文字と小文字を使うと別物 | |
| ?> | |
| <?php echo 'これはダミーだよ:' .$name. '<br />';?> | |
| <?php echo "これもダミーだよ:{.$Name}¥n<br />"; | |
| /* | |
| 文字列は.ドットを使ってつなげることが出来る | |
| "と'の違い | |
| 中の変数が値に展開されるから、特殊文字が使えるかどうか | |
| "の場合、変数が値に展開されるが | |
| 'の場合、展開されずそのまま変数名が表示される | |
| ¥nは改行、 ¥tはタブなどの特殊文字は"では反映されるが'では使えず | |
| そのまま反映される | |
| */ | |
| ?> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment