Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1.How is PHP integrated into an HTML document? 2.When is PHP interpreted by the

ID: 3902192 • Letter: 1

Question

1.How is PHP integrated into an HTML document?

2.When is PHP interpreted by the server?

3.How are PHP statements terminated?

4.What is the purpose of the settype and gettype functions?

5.List an example of settype causing data loss in a variable.

6.What is the difference between settype and casting?

7.What is the PHP string concatenation operator?

8.What does an uninitialized PHP number evaluate to? What does an uninitialized string evaluate to?

9.What is an array with non-integer indices called?

10.What is a regular expression? What is a character class?

Explanation / Answer

1)Answer:

When building a complex page, at some point you will be faced with the need to combine PHP and HTML to achieve your needed results. At first point, this can seem complicated, since PHP and HTML are two separate languages, but this is not the case. PHP is designed to interact with HTML and PHP scripts can be included in an HTML page without a problem.

In an HTML page, PHP code is enclosed within special PHP tags. When a visitor opens the page, the server processes the PHP code and then sends the output (not the PHP code itself) to the visitor's browser. Actually it is quite simple to integrate HTML and PHP. A PHP script can be treated as an HTML page, with bits of PHP inserted here and there. Anything in a PHP script that is not contained within <?php ?> tags is ignored by the PHP compiler and passed directly to the web browser. If you look at the example below you can see what a full PHP script might look like:

4)Answer:

settype:

The settype() function is used to set the type of a variable.

Version:

(PHP 4 and above)

Syntax:

gettype:

The gettype() function is used to get the type of a variable.

Version:

(PHP 4 and above)

Syntax: