echo<<<EOT
My name is "$name". I am printing some $foo->foo.
Now, I am printing some{$foo->bar[1]}.
This should printing a capital 'A':\x41
EOT;上面的这段好象里面不能用变量.
改后的如下.我试了好用.
echo "T My name is ".$name." I am printing some ".$foo->foo." Now, I am rinting some{".$foo->bar[1]."} This should printing a capital 'A':\x41 ";
My name is "$name". I am printing some $foo->foo.
Now, I am printing some{$foo->bar[1]}.
This should printing a capital 'A':\x41
EOT;上面的这段好象里面不能用变量.
改后的如下.我试了好用.
echo "T My name is ".$name." I am printing some ".$foo->foo." Now, I am rinting some{".$foo->bar[1]."} This should printing a capital 'A':\x41 ";
解决方案 »
- 为什么会报错:Parse error:syntax error,unexpected end of file in E:\wamp\www\header.php
- 求助!!请教购物网站中的“购买了该商品的顾客还浏览了其他上商品”这个推荐功能的思想及实现
- unicode码如何转换为汉字
- 虚机还没开通,高手帮看看这.htaccess文件写的对不对
- phpmyadmin登录乱码问题
- 写if else 条件的问题,在线等
- php 提供兼职工作
- CSS里solid属性控制边框样式有哪几种?
- 请问如何将.sql导入到mysql中,在线等待!
- 【在线等】请问这个地址怎么实现重写?
- phpteam 请进.关于group by 答后立即给分.
- 请帮助解决一下提示的错误!是什么原因造成的
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;/*More complex example, with variables.*/
class foo {
var $foo;
var $bar; function foo(){
$this->foo = 'Foo';
$this->bar = array('Bar1','Bar2','Bar3');
}
}$foo = new foo();
$name = 'MyName';echo <<<EOT
My name is "$name". I am printing some $foo->foo.
Now, I am printing some{$foo->bar[1]}.
This should printing a capital 'A':\x41
EOT;
?>
我值的不是里面类以及函数等的调用,
而是 echo <<<EOT 这一部分是什么意思?为什么可以这样用?
echo <<<EOT
My name is "$name". I am printing some $foo->foo.
Now, I am printing some{$foo->bar[1]}.
This should printing a capital 'A':\x41
EOT;
谢谢了:)