Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to learn PHP for beginners

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "how beginners learn PHP". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how beginners learn PHP.

1. Embedding method:

Similar to ASP

4. Variable type:

The copy code is as follows:

$mystring = "I am a string"

$NewLine = "new line"

$int1 = 38

$float1 = 1.732

$float2 = 1.4E+2

$MyArray1 = array ("son", "ugly", "Yin", "Mao")

This leads to two questions. First, the PHP variable starts with $, and the second PHP statement ends with;, which may not be suitable for ASP programmers. These two omissions are also where most of the program errors lie.

5. Operation symbol:

Mathematical operations: symbolic meaning

+ addition operation

-subtraction operation

* multiplication operation

/ division operation

% remainder

+ + accumulate

-- decreasing

String operation:

There is only one operational symbol, which is the full stop in English. It can concatenate strings into a new merged string. Similar to & in ASP

Program code

The copy code is as follows:

This also leads to two questions. First, the output statement in PHP is echo, the second is similar to that in ASP, and it can also be used in PHP.

What's particularly important here is that judging whether equality is = rather than =, which is a common mistake made by ASP programmers, = is an assignment.

Example: the executive part of this example has three lines, and the curly braces cannot be omitted.

Program code

The copy code is as follows:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report