PHP casting operators
$myText = (string)$myVar;
There are more details for string casting and conversion in the Strings section of the PHP manual, including special handling for booleans and nulls.
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
Want to have your say? just login


Be first to show your opinion !!!