Php-mysql Course

PHP has both integer and float (decimal) number types. These two types can be classified under the generic title numbers.
Valid numbers can be anything like:   8,   258,   -37,   89.25,   -3.5785,   5.5e2
- Number-type values are never quoted. The numbers added within quotes are strings with numeric values.
PHP supports a maximum integer of around two billion on most platforms (UNIX and Windows). With numbers larger than that, PHP will automatically use a floating-point type.

1. Numbers and Operator

The mathematical operators are specific symbols that performs mathematical calculations.
Operators act on the variables and numbers presented in PHP instructions.

The standard mathematical (Arithmetic) operators


Assignment Operators


The mathematical calculations in PHP, as in arithmetic, are taken into account the operators precedence (the order in which complex calculations are made). If you want to force the execution order, you must group clauses in parentheses. Check the fallowing example:
<?php
$x = 8 + 3 * 5 -2;
echo $x;                  // 21 (first 3*5 [15], then adds 8 and substract 2 )

$x = (8+3) * (5-2);
echo '<br />'. $x;        // 33  (first 8+3  [11], then  5-2 [3], then makes the multiplication  11*3 [33] )
?>

2. PHP mathematical functions

Along with the arithmetic operators you can use PHP mathematical functions for more complex operations.
Here are some examples of functions:

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag adds an image in web page?
<div> <img> <span>
<img src="http://coursesweb.net/imgs/webcourses.gif" width="191" height="63" alt="Courses-Web" />
Which of these CSS codes displays the text oblique?
font-style: italic; text-decoration: underline; font-weight: 500;
#id {
  font-style: italic;
}
Click on the jQuery function used to hide with animation a HTML element.
click() hide() show()
$(document).ready(function() {
  $(".a_class").click(function(){ $(this).hide("slow"); });
});
Click on the correctly defined function in PHP.
fname function() {} function fname() {} function $fname() {};
function fname($a, $b) {
  echo $a * $b;
}
Numbers and mathematical 0perators

Last accessed pages

  1. Send POST data with file_get_contents (2929)
  2. Egg shape with CSS (3223)
  3. Dynamic variables in JavaScript (18734)
  4. The School for Gods (5795)
  5. Heart shape with CSS (2460)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (322)
  2. Read Excel file data in PHP - PhpExcelReader (118)
  3. The Four Agreements (97)
  4. PHP Unzipper - Extract Zip, Rar Archives (94)
  5. The Mastery of Love (86)
Chat
Chat or leave a message for the other users
Full screenInchide