include my added text to the file (#18972)
This commit is contained in:
committed by
Quincy Larson
parent
d39331967e
commit
c87c76f8cb
@ -3,9 +3,66 @@ title: PHP Operators
|
|||||||
---
|
---
|
||||||
## PHP Operators
|
## PHP Operators
|
||||||
|
|
||||||
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/php/php-operators/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
|
<p>Operators are used to perform operations on variables and values.</p>
|
||||||
|
<p>PHP divides the operators in the following groups:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Arithmetic operators</li>
|
||||||
|
<li>Assignment operators</li>
|
||||||
|
<li>Comparison operators</li>
|
||||||
|
<li>Increment/Decrement operators</li>
|
||||||
|
<li>Logical operators</li>
|
||||||
|
<li>String operators</li>
|
||||||
|
<li>Array operators</li>
|
||||||
|
</ul>
|
||||||
|
<h3>PHP Arithmetic Operators</h3>
|
||||||
|
<p>The PHP arithmetic operators are used with numeric values to perform common arithmetical operations, such as addition, subtraction, multiplication etc.</p>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Operator</th>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Example</th>
|
||||||
|
<th>Result</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>+</td>
|
||||||
|
<td>Addition</td>
|
||||||
|
<td>$a + $b</td>
|
||||||
|
<td>Sum of $a and $b</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>-</td>
|
||||||
|
<td>Subtraction</td>
|
||||||
|
<td>$a - $b</td>
|
||||||
|
<td>Difference of $a and $b</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>*</td>
|
||||||
|
<td>Multiplication</td>
|
||||||
|
<td>$a * $b</td>
|
||||||
|
<td>Product of $a and $b</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>/</td>
|
||||||
|
<td>Division</td>
|
||||||
|
<td>$a / $b</td>
|
||||||
|
<td>Quotient of $a and $b</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>%</td>
|
||||||
|
<td>Modulus</td>
|
||||||
|
<td>$a % $b</td>
|
||||||
|
<td>Remainder of $a divided by $b</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>**</td>
|
||||||
|
<td>Exponentiation</td>
|
||||||
|
<td>$a ** $b</td>
|
||||||
|
<td>Result of raising $a to the $b'th power </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
|
|
||||||
|
|
||||||
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
|
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user