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)

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