PHP summary (1)-php Tutorial

Source: Internet
Author: User
PHP summary (1)
 '1', 'key' => '2', 1 => 3 array */$ arr [] = "1 "; $ arr ["key"] = "2"; $ arr [] = 3;/*** @ 2 * isset to determine whether a variable exists, or the value is null * The first type is to assign a value to $ name. it is determined by $ name. a Warning */$ name = $ _ GET ["name"] is generated during the assignment process. if (isset ($ name) {echo "TRUE" ;}if (isset ($ _ GET ["name"]) {echo "TRUE ";} /*** @ 3 * ==== operator comparison size and type, ==== compare size * output ==, null and false are equal in =; when === not equal */$ bl = null; $ bol = false; if ($ bl = $ bol) {echo "= ";} if ($ bl = $ bol) {echo "=";}/*** @ 4 * the static member variable must contain The $ CHARACTER * getName is a static member method by default. The difference is $ this-> name */class user {public static $ var = array (1); public $ name; function getName () {var_dump (self: $ var) ;}} user: getName ();/*** @ 5 * $ count has a warning about undefined variables, but it still outputs 6. for variables do not belong to local variables. * $ Count is initialized to 0 by default */for ($ I = 0; $ I <4; $ I ++) {$ count + = $ I;} echo $ count; /*** @ 6 * if either of the two conditions is true, the OR operator displays a record. * Use Field = $ condition OR $ condition = ''to indicate that $ condition exists, if the condition does not exist, the * IN operator is generally used at the end of SQL to improve efficiency. */$ SQL = "SELECT * FROM Persons WHERE (FirstName = 'Thomas 'OR FirstName = 'William') AND LastName = 'cart'";?>

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.