Export (0) Print
Expand All
2 out of 2 rated this helpful - Rate this topic

PHP overview

PHP is a server-side scripting language that enables you to build dynamic web pages. PHP pages may contain text, HTML, and script blocks. When a browser requests a PHP page, the PHP script is executed on the web server, and the resulting HTML is displayed in the browser.

A PHP page must have a PHP-supported extension. Typically, a PHP file ends with .php, although other PHP extensions such as .php4 and .phtml also exist. However, .php is the most common extension.

Cc294979.alert_caution(en-us,Expression.10).gifImportant:

For web browsers to correctly display your published PHP pages, PHP must be installed and configured on your web server. For more information, see Install Expression Development Server and Preview a PHP page.

To create a new PHP page

  • Do one of the following:

    • On the File menu, point to New, and then click PHP.

    • On the File menu, click New. In the New dialog box, on the Page tab, click General, then click PHP, and then click OK.

PHP script blocks

A PHP script block can appear anywhere in a .php page, and each page can contain more than one PHP script block. A PHP script block must begin with <?php and end with ?>.

The following is an example of a PHP script block:

<?php
echo "Hello World";
?>

To insert a PHP script block

  • On the Insert menu, click PHP Script.

You can also customize the display of your PHP code in Code view so that you can easily identify your PHP script blocks in the page. For more information, see Change the color of PHP code.

For more information about PHP, see PHP Tutorial on the W3 Schools website.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.