How can I execute a PHP script using command line?
Answers were Sorted based on User's Feedback
Answer / nikunj
By using CLI ( command line interface)
On command prompt type : php filename
Is This Answer Correct ? | 33 Yes | 5 No |
Answer / tamilselvan
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
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 ? | 12 Yes | 4 No |
Answer / 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 |
How can we destroy the session, how can we unset the variable of a session?
Is numeric in php?
just explain MYSql ISAM and InnoDB functions. and what is the diffrent between both. and which is the better in both.
How to get the total number of values in an array?
write the function to fetch a image from mysql databases (datatype blob).
What is the use of dual table in mysql?
Explain the importance of the function htmlentities.
Is salary a ratio or interval?
What are the features of object-oriented programming in php?
how to insert logout time when browser close
can we swap two different string using php for example:-- before swapping:-- 1 string :-hello friend, 2 string :-my dear, after swapping that strings will be: 1.hello dear, 2.my friend.
Which is variable cost?