Pregunta

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?

¿Fue útil?

Solución

This would be true if calling php from console.

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

Otros consejos

Have you tried the simple :

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

?

By default, php print on STDOUT.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top