Re: question about <<<EOF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 30 Sep 2008 12:48:35 +0800, LKSunny wrote:

>i want on inner EOF do something, calculate and call function ? can not ? if 
>yes, how to ?

Same way as you do with "" strings. e.g.

<?php
class foo {
  function bar() {
    return 'world!';
  }

  function hello() {
    echo <<<ENDHELLO
Hello, {$this->bar()}
ENDHELLO;
  }
}

$foo = new foo();
$foo->hello();
?>
-- 
Ross McKay, Toronto, NSW Australia
"Let the laddie play wi the knife - he'll learn"
- The Wee Book of Calvin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux