What are the different types of statements that are present in PHP?

There are four kinds of PHP statements that are present. They are as follows:
• Simple statement- these are the echo statements and end with a semicolon (;). PHP ignores white spaces between simple statements. Until it finds a semicolon it reads the statement.
• Complex/Conditional statements: these are the statements which deal with certain conditions that have to be executed to meet certain specific requirements. These are if and else block or switch statements. PHP reads the complete statement and doesn’t stop at the first semicolon it encounters. It looks for starting and ending braces to end the execution.
• Looping statements: statements that are repeated in a block. The feature that enables you to execute the statements repeatedly is called as loop. For example: for loop, while loop, do..while loop.

Why PHP is sometimes called as embedded scripting language?

PHP is a high level language which is used to allow users to write and understand it in human readable form and also use an interpreter to interpret the code which user write for the computer. PHP is used as an embedded scripting language for the web. PHP is embedded in HTML code. HTML tags are used to enclose the PHP language. HTML is used and PHP is code written in it in the same way as you write JavaScript in HTML.

What are the different types of Errors in PHP?

There are three basic types of runtime errors in PHP:

1. Notices: These are small, non-critical errors that PHP encounters while executing a script – for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all – although the default behavior can be changed.

2. Warnings: Warnings are more severe errors like attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.

3. Fatal errors: These are critical errors – for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP’s default behavior is to display them to the user when they take place.

What is MIME?

MIME – Multi-purpose Internet Mail Extensions.

MIME types represents a standard way of classifying file types over Internet.

Web servers and browsers have a list of MIME types, which facilitates files transfer of the same type in the same way, irrespective of operating system they are working in.

A MIME type has two parts: a type and a subtype. They are separated by a slash (/).

MIME type for Microsoft Word files is application and the subtype is msword, i.e. application/msword.