Created
February 23, 2013 16:21
-
-
Save shigemk2/5020305 to your computer and use it in GitHub Desktop.
ヒアドキュメントでクラスのメソッドを使おう
This file contains 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 | |
class Hoge { | |
function fuga() { | |
return 'FUGA'; | |
} | |
} | |
$hoge = new Hoge(); | |
$str = <<<EOT | |
{$hoge->fuga()} | |
EOT; | |
echo $str; // FUGA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment