It’s been awhile since I’ve dabbled in PHP.
I want to (a) populate a screen for the user to view, (b) ask the user if she wants to print that screen then (c) ask if the user wants another populated screen. If I could get these responses (b) and (c) without the hassle of forms, I’d use a do … while and be able to retain my local data.
I’ve tried “readline”, but I don’t think it works on Windows [aren’t we surprised?]. The alternative in [http://php.net/manual/en/function.readline.php] (http://php.net/manual/en/function.readline.php) contains this code.
<?php if (PHP_OS == 'WINNT') { echo '$ '; $line = stream_get_line(STDIN, 1024, PHP_EOL); } else { $line = readline('$ '); } ?>
I assume it works, but isn’t there an easier way?