System Summary: The Essence and tips of PHP development language _ PHP Tutorial

Source: Internet
Author: User
Tags php template
The system summarizes the essence and skills of PHP development language. Many PHP programmers, especially those who have not been learning for a long time, do not know the essence of PHP. How did Perl become famous in the business world? Its powerful regular expression. What about PHP? He is a PHP programmer who has been studying PHP for a long time and does not know the essence of PHP. How did Perl become famous in the business world? Its powerful regular expression. What about PHP? He is a language developed from Unix. of course, he inherits many features of Perl and has advantages in C. Fast, concise, and clear. especially for C programmers, PHP is a favorite. I love PHP very much (I forgot my girlfriend ). Here, I want to write an article about PHP variables, array application skills, PHP regular expressions, and PHP template applications. I will try again later to write the full combination of PHP, COM, PHP, and XML.

1. Application techniques of variables and arrays

(1) a lot of array functions are rarely used. Foreach, list, and each. Here are a few examples. Example:

  

$ Data = array ('a' => 'data1', 'B' => 'data2 ', 'C' => 'data3 ');

While (list ($ subscript, $ value) = each ($ data ))

{

Echo "$ subscript => $ value ::";

Echo "$ subscript => $ valuen

";

}

Reset ($ data );

Foreach ($ data as $ subscript => $ value)

{

Echo "$ subscript => $ value ::";

Echo "$ subscript => $ valuen

";

}

(2) function variables, variable variables, and variable "pointers ":

  

// Variable

$ Var = "this is a var ";

$ Varname = "var ";

Echo $ varname;

// Function variable

Function fun1 ($ str ){

Echo $ str;

}

$ Funname = "fun1 ";

$ Funname ("This is a function! ");

?>

The "pointer" of the variable ". This pointer is enclosed in double quotes, indicating that it is not a real pointer. Take a look at the following example:

  

Function ($ ){

$ A ++;

}

$ C = 0;

Function ($ c );

Echo $ c; // $ c is still 0

Function (& $ ){

$ A ++;

}

$ C = 0;

Echo $ c; // $ c is 1

?>

It is called "pointer" because it has the same function as the pointer in C language. But this is not a real pointer. it can only be understood in this way.
  • 2 pages in total:
  • Previous Page
  • 1
  • 2
  • Next page

Bytes. How did Perl become famous in the business world? Its powerful regular expression. What about PHP? He is a slave...

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.