PHP development practice authoritative guide, php Practice Guide

Source: Internet
Author: User
Tags php and mysql

PHP development practice authoritative guide, php Practice Guide
3.2.1 variable declaration and naming

1 <? Php 2 $ title = "hello"; // correct 3 $ title123 = "hello"; // correct 4 $123 title = "hello "; // error 5 $ _ title = "hello"; // correct 6 $ @ # title = "hello"; // error 7 $ url = "hello "; // get the variable url 8 echo $ url; // result: hello 9 unset ($ url); // Delete the variable url10 echo $ url; // The result is null 11?>
3.2.2 variable and Reference Assignment
1 <? Php2 $ var = "php"; 3 $ php = "hello"; 4 echo $ var; // output result php5 echo $ var; // output result hello6?>
3.3.1 string
1 <? Php2 $ title = "hello"; 3 echo '$ title, world'; // result: $ title, world4 echo "$ title, world"; // result: hello, world5 echo "$ {title}, world"; // result: hello, world6 echo "{$ title}, world"; // result: hello, world7 echo "\ $ title, world"; // result: $ title, world8?>
3.3.8 type forced conversion and Application
// Convert other types to integer type <? Php $ php = 100.10; echo (int) $ php; // output result: 100 $ php = true; echo (int) $ php; // output result: 1 $ php = "123php"; echo (int) $ php; // output result: 123 $ php = "php123"; echo (int) $ php; // output result: 0?> // Convert other types to string type <? Php $ php = 100.1; var_dump (string) $ php); // output result: string (4) "100.1" $ php = true; echo (string) $ php; // output result: 1?> // Convert other types to floating point type <? Php $ php = "123.2php"; var_dump (float) $ php); // output result: float (123.2) $ php = "php123.2"; var_dump (float) $ php); // output result: (0)?> // Convert other types to boolean <? Php $ php = "php"; var_dump (bool) $ php); // output result: bool (true) $ php = 0; var_dump (bool) $ php ); // output result: bool (false)?>

 


If you want to learn how to create a web page in PHP, do you have any examples that are associated with the web page setting background program?

Php and mysql web development
<Php development practice authoritative guide
However, you need html javascript or jquery at the front-end.

If you want to learn how to create a web page in PHP, do you have any examples that are associated with the web page setting background program?

Php and mysql web development
<Php development practice authoritative guide
However, you need html javascript or jquery at the front-end.

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.