PHP.nl

strval

strval

Get string value of a variable

string **strval** mixed $value

Get the string value of a variable. See the documentation on for more information on converting to string. string

This function performs no formatting on the returned value. If you are looking for a way to format a numeric value as a string, please see or . sprintf``number_format

value The variable that is being converted to a . string

    may be any scalar type, ,
   or an  that implements the 
   method. You cannot use  on arrays or on
   objects that do not implement the
    method.
  `value``null``object`__toString()`strval`__toString()

The value of . string``value

**Voorbeeld: example using PHP magic method. **

<?php
class StrValTest
{
    public function __toString()
    {
        return __CLASS__;
    }
}

// Prints 'StrValTest'
echo strval(new StrValTest);
?>

boolval``floatval``intval``settype``sprintf``number_formatType juggling__toString()