PHP Interview questions

Total available count: 33
Subject - PHP Frameworks
Subsubject - PHP

How to execute a PHP script using command line?

Run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument.

To run php interactively: (so you can paste/write code in the console)

php -a

To make it parse file and output to console:

php -f file.php

Parse file and output to another file:

php -f file.php > reults.html

Do you need something else? To run only small part, one line or like, you can use:

php -r '$x = "Slightbook"; echo "$x\n";'

If you are running linux then do man php at console.

Next 5 interview question(s)

What is the difference between include and require?
Who is father of PHP?
What are the different types of errors in PHP?
Explain about include(), require(), include_once() and require_once() ?
What is PHP?