質問

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