-The r parameter can directly execute a piece of code, no? Php, for example, php-rphpinfo (); The-R parameter can execute a piece of code for each line of the standard input. There are two variables, $ argi is the row number, and $ argn is the content of the current row. For example, ls | php-Recho $ argit $ argnn;-B and-E indicate that
-The r parameter can directly execute a piece of code, no? For example, the php-r 'phpinfo (); '-R parameter can execute a piece of code for each line of the standard input. There are two variables, $ argi is the row number, and $ argn is the content of the current row. For example, ls | php-R 'echo "$ argi/t $ argn/n"; '-B,-E indicates that
-The r parameter can directly execute a piece of code without the need For example, php-r 'phpinfo ();'
The-R parameter can execute a code segment for each line of the standard input. There are two variables, $ argi is the row number, and $ argn is the content of the current row.
For example, ls | php-R 'echo "$ argi/t $ argn/n ";'
-B and-E indicate the scripts executed at the beginning and end of the Input Processing respectively.
For example, ls | php-R 'echo "$ argi/t $ argn/n"; '-B' echo "Begin/n "; '-e' echo "End/n ";'
The result is
Begin
1 a.txt
2 B .txt
3 c.txt
...
End
For more parameters, see man php.
What are the advantages of using php in scripts? Php includes many common functions for web applications. For example, escape html and url. It is much easier to process the data.