PHP embeds PHP in HTML

Source: Internet
Author: User
Tags time and date

PHP Markup in PHP

<?php

?>

The output statement in PHP is the Echo

<? PHP Echo "<p>php OUTPUT Statement! </p> ";? >

Here, we do not use PHP to achieve pure HTML does not implement the function

The main reason to use the server-side scripting language is to be able to provide dynamic content to site users, which is a very important application, because the user needs or changes over time to enable users to constantly access the site

PHP can easily implement this function, the following is a time real output

Note: The PHP statement ends with a semicolon (;).

<! DOCTYPE html>PHP // This is a single-line comment # This is also a single-line comment /* This is a multiline comment block that spans multiple lines of */?></body>

Note://This is a single-line comment

#这也是单行注释

/* Multiline Comment

*/

Add Dynamic Content

<? PHP Echo ' <p>order processed at '; Echo Date (H:i,js,f,Y); Echo ' </p> ';? >

The above code can also be used with the operator (.). Write it in one line of code. Take a look below

<? PHP Echo ' <p>order processed at '. Date (' H:i,js F Y '). ' </p> ';? >

In the above code, we use the built-in date () function of PHP to tell the customer the date and time the order was processed, and when the script is run, it displays a different time and date.

PHP embeds PHP in HTML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.