I want to write some text from script in browser.

<?php
$out = fopen('php://stdout', 'w');
fprintf($out, "Hello!");
fclose($out);
?>

I expect "Hello!" on output, but nothing happens...Could it be bug in stdout, or I just oversighted something?

有帮助吗?

解决方案

This would be true if calling php from console.

But if you are talking about web access, you should use php://output

其他提示

Have you tried the simple :

<?php
$out = "foobar";
echo $out;
?>

?

By default, php print on STDOUT.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top