I tried looking up (int)
but could only find documentation for the function int()
in the PHP manual.
Could someone explain to me what the above
it casts the variable following it to integer. more info from documentation: http://php.net/manual/en/language.types.type-juggling.php
Type casting in PHP works much as it does in C: the name of the desired type is written in parentheses before the variable which is to be cast.
The casts allowed are:
- (int), (integer) - cast to integer
- (bool), (boolean) - cast to boolean
- (float), (double), (real) - cast to float
- (string) - cast to string
- (array) - cast to array (object) - cast to object
- (unset) - cast to NULL