Etiqueta: PHP

Execution Operators

PHP supports one execution operator: backticks («). Note that these are not single-quotes! PHP will attempt to execute the contents of the backticks as a shell command; the output will be returned (i.e., it won’t simply be dumped to output; it can be assigned to a variable). Use of the backtick operator is identical to

Continuar leyendo...

Error Control Operators

PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored. If the track_errors feature is enabled, any error message generated by the expression will be saved in the variable $php_errormsg. This variable will be overwritten

Continuar leyendo...

Comparison Operators

Comparison operators, as their name implies, allow you to compare two values. You may also be interested in viewing the type comparison tables, as they show examples of various type related comparisons. <- Scroll Horizontal disponible en esta tabla -> Comparison Operators Example Name Result $a == $b Equal TRUE if $a is equal to

Continuar leyendo...

Bitwise operators

Bitwise operators allow evaluation and manipulation of specific bits within an integer. <- Scroll Horizontal disponible en esta tabla -> Bitwise Operators Example Name Result $a & $b And Bits that are set in both $a and $b are set. $a | $b Or (inclusive or) Bits that are set in either $a or $b

Continuar leyendo...

Assignment Operators on PHP

The basic assignment operator is «=». Your first inclination might be to think of this as «equal to». Don’t. It really means that the left operand gets set to the value of the expression on the rights (that is, «gets set to»). The value of an assignment expression is the value assigned. That is, the

Continuar leyendo...

Arithmetic Operators on PHP

Remember basic arithmetic from school? These work just like those. <- Scroll Horizontal disponible en esta tabla -> Arithmetic Operators Example Name Result -$a Negation Opposite of $a. $a + $b Addition Sum of $a and $b. $a – $b Subtraction Difference of $a and $b. $a * $b Multiplication Product of $a and $b.

Continuar leyendo...

Operator Precedence on PHP

The precedence of an operator specifies how «tightly» it binds two expressions together. For example, in the expression 1 + 5 * 3, the answer is 16 and not 18 because the multiplication («*») operator has a higher precedence than the addition («+») operator. Parentheses may be used to force precedence, if necessary. For instance:

Continuar leyendo...

Operators on PHP

Operator Precedence Arithmetic Operators Assignment Operators Bitwise Operators Comparison Operators Error Control Operators Execution Operators Incrementing/Decrementing Operators Logical Operators String Operators Array Operators Type Operators An operator is something that you feed with one or more values (or expressions, in programming jargon) which yields another value (so that the construction itself becomes an expression). So

Continuar leyendo...

Magic constants for PHP

PHP provides a large number of predefined constants to any script which it runs. Many of these constants, however, are created by various extensions, and will only be present when those extensions are available, either via dynamic loading or because they have been compiled in. There are seven magical constants that change depending on where

Continuar leyendo...

Expressions on PHP

Expressions are the most important building stones of PHP. In PHP, almost anything you write is an expression. The simplest yet most accurate way to define an expression is «anything that has a value». The most basic forms of expressions are constants and variables. When you type «$a = 5″, you’re assigning ‘5’ into $a.

Continuar leyendo...