How can I execute a PHP script using command line?
Answer Posted / indra
By using CLI ( command line interface)
On command prompt type : php filename
Example:
Php –r ‘print_r(get_defined_constanrs());’
From a shell, php –v will display whether the SAPI is CLI or CGI
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
How to create a table to store files?
Explain Type hinting in PHP?
How do I escape data before storing it in the database?
What are the functions to be used to get the image's properties (size, width and height)?
How to get the number of characters in a string?
What is namespace and use in php?
What is use of header() function in php?
Can you specify the "new line" character in single-quoted strings?
What is the default session time in php?
Explain scalar type declarations in php7?
How to set session.gc_maxlifetime properly?
What is the best php version for wordpress?
How to Retrieve the Session ID of the Current Session?
How many types of php are there?
Is php harder than javascript?