Explain how to execute a PHP script using command line?

Submitted by: Administrator
PHP script using command line can be executed using SAPI (Server Application programming Interface). Using SAPI Command Line Interface the PHP code can be passed to execute directly

Php -r 'print_r(get_defined_constanrs());'

From a shell, php -v will display whether the SAPI is CLI or CGI
Submitted by:

Read Online Sr. PHP Programmer Job Interview Questions And Answers