|
Posted by yawnmoth on 05/31/07 02:07
I think this is a better way to approach my question. Here's my
script:
<?php
$stdin = fopen('php://stdin', 'r');
stream_set_blocking($stdin, false);
$last_date = '';
while (true)
{
fread($stdin, 1024);
if ($last_date != date('g:ia'))
{
$last_date = date('g:ia');
echo "The time is now [$last_date]\r\n";
}
}
If I comment out the fread, it echo's the time once a minute. If I
leave the fread as it is, it doesn't. My question is... why?
Blocking is set to false, so why does it appear to be blocking, anyway?
Navigation:
[Reply to this message]
|