Home > Backend Development > PHP Tutorial > In those years, the PHP self-increment and self-subtraction operations we have pursued (1)_PHP Tutorial

In those years, the PHP self-increment and self-subtraction operations we have pursued (1)_PHP Tutorial

WBOY
Release: 2016-07-13 10:27:34
Original
979 people have browsed it

-------------------------------------------------- --------------------------------------------------

PHP doesn’t have many arithmetic symbols, but not all of them do you know how to use?

Here let’s talk about the upgraded version of PHP’s arithmetic symbols: ++, --, haha.

----------------------@chenwei ------------- ----------------

++ means self-increment,

-- That is, self-decreasing.

Practical application:

$a = 10; $a++ = ? //Use first and then add, the final result is 11

$a = 10; ++$a = ? //Add first and then use, the final result is 11

$a = 10;

$b = $a++ + ++$a;

echo $a;

echo $b; //Let’s do the math and I’ll reply with the answer

-------------------------------------------------- --------------------------------------------------

http://www.cnblogs.com/farwish/p/3795614.html

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/815976.htmlTechArticle--------------------- -------------------------------------------------- ------------------ There are not many operation symbols in PHP, but not all of them do you know how to use? Here we come...
Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template