How to learn the first day of php in ten days

Source: Internet
Author: User
I used to learn ASP for ten days and ASP. NET for ten days. now I want to write another PHP, which is quite complete. I won't talk about the debugging method of PHP here. many articles outside of the company have their advantages and different combinations. I am using

I used to learn ASP for ten days and ASP. NET for ten days. now I want to write another PHP, which is quite complete. I won't talk about the debugging method of PHP here. many articles outside of the company have their advantages and different combinations. I am currently using Apache web server and my SQL as WEB server and database, in the php-4.3.3 environment to do the program. Of course, it is essential to briefly construct and visit PHPMYADMIN to view the database.
As for form design, I don't want to talk much about it here. I already have a prefix in "Ten days learning ASP.

The following briefly introduces the PHP syntax.

1. Embedded method:

PHP can be <? Php or <?, End symbol?>, Of course, you can also specify it yourself.

2. Reference File:

There are two methods to reference files: require and include.
For example, require ('myrequirefile. php ');. This function is usually placed at the beginning of the PHP program. before the PHP program is executed, it will first read the file specified by require to make it a part of the PHP program webpage. You can also use this method to introduce common functions to webpages.

Include application methods such as include ('mydomaindefile. php ');. This function is generally placed in the processing part of the process control. The PHP program webpage reads the include file. This method can simplify the process of program performance.

3. annotation method:

<? Php
Echo 'this is the first example. \ N'; // In this example, the C syntax annotation is used.
/* This example uses multiple rows
Annotation method */
Echo 'this is the second example. \ N ';
Echo 'is the third example. \ N'; # UNIX Shell syntax comment is used in this example.
?>

4. variable type:

$ Mystring = 'I am string ';
$ NewLine = 'newline \ n ';
$ Int1 = 38;
$ Float1 = 1.732;
$ Float2 = 1.4E 2;
$ MyArray1 = array ('sub', 'Ugly ', 'yin', 'Mao ');

Two headers are introduced here. First, the PHP variable starts with $, and the second PHP statement ends with;, which may be unsuitable by ASP programmers. These two omissions are also the cause of many program errors.

5. operator number:

Mathematical operations: Symbolic meaning
Addition operation
-Subtraction
* Multiplication
/Division
% Obtain the remainder
Accumulate
-- Decrease

String operation:

There is only one operator number, which is an English ending. It can be used to connect strings and convert them into new merged strings. Similar &
<?
$ A = 'php 4 ';
$ B = 'powerful power ';
Echo $ a. $ B;
?>
Two headers are also introduced here. the output statement in PHP is echo, and the second is similar to the <% = variable %> in ASP, which can be used in PHP. <? = Variable? >.

Logical operation:

Symbolic meaning
<Less
> Greater
<= Less than or equal
> = Greater than or equal
= Is
! = No
& And (And)
And (And)
Or (Or)
Or (Or)
Xor exclusive or (Xor)
! No (Not)

Let's talk about this today. let's talk about process control tomorrow.

Related Article

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.