Just define STDIN
constant at top of your file,
define('STDIN',fopen("php://stdin","r"));
More Related Contents:
- Read each line of txt file to new array element
- How to select first 10 words of a sentence?
- PHP standard input?
- how to redirect STDOUT to a file in PHP?
- How to pass variables as stdin into command line from PHP
- How to remove the leading character from a string?
- PHP – Returning the last line in a file?
- Explode string on commas and trim potential spaces from each value
- PHP ltrim behavior with character list
- PHP CLI: How to read a single character of input from the TTY (without waiting for the enter key)?
- Php how to remove any last commas [duplicate]
- Trim leading white space with PHP?
- While loop within While loop not looping
- How do I write a CSS for mouse hover [duplicate]
- How to check if a row exists in MySQL? (i.e. check if username or email exists in MySQL)
- Difference between require, include, require_once and include_once?
- Is it possible to define a class property value dynamically in PHP?
- Get the current script file name
- How to use PHP OPCache?
- MySQL returns only one row
- Characters allowed in php array keys?
- How to chain method on a newly created object?
- How to get email address from a long string
- Will copy-on-write prevent data duplication on arrays?
- Count specific values in multidimensional array
- Get numbers from string with PHP
- php variable inside echo ‘html code’
- Warning: mysql_num_rows() expects parameter 1 to be resource, object given [duplicate]
- php count xml elements
- Regex/ code to fix corrupt serialized PHP data.