Say I want to analyze files and strip out their HTML as I view it. I could cat <file> but there's no strip-html feature in Linux. I could write a script that uses PHP's strip_tags feature, but I'd prefer it if I could code it in such a way that it can read live input, like if I were watching live traffic and not a static file. How can I pipe data to a PHP script and have it read the data line-by-line as it comes in? I want to be able to do this:
cat <file> | stripper.php
(where stripper's header is #!/usr/bin/php -q of course)
Ideas? I'm guessing you read from STDIN but I'm not sure how to do that entirely in this case.
Thanks!
Mike