An operator is a symbol that tells PHP to perform a mathematical or logical operation. Some operators expect two arguments, some only one. Most operators fall into three categories: arithmetic, logical, and bitwise. There are some exceptions, however.
Addition, subtraction, multiplication, and division are familiar concepts. They may be applied to integers or doubles. Using a string with an arithmetic operator causes the string to be converted to a number first. Modulo division returns the integer remainder of a division. The - operator may also be used to swap the sign on a number or variable. The increment and decrement operators are shorthand for adding or subtracting 1 from a ariable. You might remember that we used it. You may put an increment or decrement operator before or after a variable. If the variable is within an expression, you will get one of two behaviors. If an increment operator precedes the variable, the variable will be incremented prior to evaluation of the expression; otherwise the variable isn't operated on until after the value of the expression is computed.
Comparing Preincrement to Postincrement<?
In this first print statement VisitorsToday still contains the value 1 when it is printed, because the increment operator isn't applied until after the expression is evaluated. In the third print statement VisitorsToday is incremented before the expression is evaluated; therefore 3 is sent to the browser.
PHP Related Interview Questions
|PHP Interview Questions||MySQL Interview Questions|
|PHP+MySQL Interview Questions||Drupal Interview Questions|
|MYSQL DBA Interview Questions||PHP5 Interview Questions|
|WordPress Interview Questions||Joomla Interview Questions|
|CakePHP Interview Questions||CodeIgniter Interview Questions|
|PHP7 Interview Questions|
An Introduction To Php
Variables, Operators, And Expressions
Classes And Objects
I/o And Disk Access
Time, Date, And Configuration Functions
Parsing And String Evaluation
Sorting Searching And Random Numbers
Integration With Html
Efficiency And Debugging
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.