PHP Beginner PHP Primer (1) _php tutorial

Source: Internet
Author: User
PHPis a server-side scripting language that is easy to learn and use. With minimal programming knowledge, you can use PHP to build a truly interactive web site. This section of this article will let you familiarize yourself with PHP. I could not have done without any omission, and my purpose was only to allow you to quickly start your PHP programming.

I. First and foremost conditions

You first have to have a working Web server that supports PHP. I assume that all PHP files on your server have a. php3 extension.

Second, the installation of PHP

Generate a file named Test.php3 that contains the following:

 
  

Then open the file in your browser. Look at this page and you'll know the options for your PHP installation.

Third, grammar

As mentioned earlier, you can mix and write your PHP code and HTML code. So you have to have a way to differentiate between the two. Here are a few ways you can do it. You can choose one of the things that you are most comfortable with and stick to it this way!

Detach from HTML

Here are the methods you can use:

 
  

Statement

As with Perl and C, the statements are delimited in PHP (;). Flags that are separated from HTML also represent the end of the statement.

Comments

PHP supports c,c++ and UNIX-style annotation methods:

 
  
  1. /* c,c++ style multi-line Comment */
  2. C + + style line Comment

Example: hello,world!

With the knowledge that we have learned, you can write a simplest program output that is perhaps the most famous word in the program world:

 
  1. < HTML >
  2. < HEAD >
  3. < TITLE >
  4. Echo "Hello world!";
  5. ?>
  6. TITLE >
  7. HEAD >
  8. < BODY >
  9. < H1 >
  10. First PHP page
  11. H1 >
  12. < HR >
  13. Single line C + + style Comment
  14. /*
  15. Printing the message
  16. */
  17. echo "Hello world!";
  18. # Unix Style single line comment
  19. ?>
  20. BODY >
  21. HTML >

1

http://www.bkjia.com/PHPjc/445779.html www.bkjia.com true http://www.bkjia.com/PHPjc/445779.html techarticle PHP is a server-side scripting language that is easy to learn and use. With minimal programming knowledge, you can use PHP to build a truly interactive web site. And this part of this article will let you to ...

  • 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.