Possible Duplicate:
Why does PHP echo d text lose it s formatting?
I got strange problem. Let s say I got code like this:
<?php
class Bar
{
private $foo;
function __construct ($foo)
{
$this->foo = $foo;
}
public function testFoo($obj)
{
echo $obj->foo . PHP_EOL;
}
}
$obj = new Bar("obj");
$obj2 = new Bar("obj2");
$obj->testFoo($obj);
$obj->testFoo($obj2);
?>
而不是取得预期结果:
obj
obj2
这是我得到的:
obj obj2
It s just like PHP_EOL represents blank space. I also tried to use " " but this one works same. I m using latest XAMPP.