Last active
June 11, 2019 16:19
-
-
Save onesword0618/4c92b32dc95968fcad3a71ccfa36f2ec 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
| <?php | |
| $juices = array("apple", "orange", "koolaid1" => "purple"); | |
| echo "He drank some $juices[0] juice.".PHP_EOL; | |
| echo "He drank some $juices[1] juice.".PHP_EOL; | |
| echo "He drank some $juices[koolaid1] juice.".PHP_EOL; | |
| class people { | |
| public $john = "John Smith"; | |
| public $jane = "Jane Smith"; | |
| public $robert = "Robert Paulsen"; | |
| public $smiths = "Smiths"; | |
| } | |
| $people = new people(); | |
| echo "$people->john drank some $juices[0] juice.".PHP_EOL; | |
| echo "$people->john then said hello to $people->jane.".PHP_EOL; | |
| echo "$people->john's wife greeted $people->robert.".PHP_EOL; | |
| echo "$people->robert greeted the two $people->smiths.".PHP_EOL; | |
| ?> |
Author
Author
PHP_EOL
は改行コードを表している。
自動で実行環境の改行コードに置換してくれる
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
リファレンスのサンプルコード
動作不良を起こしているのは
https://gist.github.com/onesword0618/4c92b32dc95968fcad3a71ccfa36f2ec#file-juices-php-L13
または、変数の設定値が変だった
https://gist.github.com/onesword0618/4c92b32dc95968fcad3a71ccfa36f2ec#file-juices-php-L21