Quote:
Originally posted by Neo
=> is equal or greater than
if (3=>10) {
// do this
}
|
Actually, this is incorrect for PHP. The "greater than or equal" operator is >=, "less than or equal" is <=.
The => operator is something different entirely. It is most commonly used in a foreach control structure, such as:
PHP Code:
foreach ($array as $key => $value) {
echo "Key: $key; Value: $value<br>\n";
}
The operator tells the interpreter to link each key/value pair from the array as a matching entity. This is commonly used to access a hash-table-type data structure.