No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

strval

(PHP 4, PHP 5, PHP 7)

strvalGet string value of a variable

Description

strval ( mixed $var ) : string

Get the string value of a variable. See the documentation on string for more information on converting to 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 sprintf() or number_format().

PHP: strval - Manual Home of Manuel PHP  Contents Haut

Parameters

var

The variable that is being converted to a string.

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

PHP: strval - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 strval() example using PHP 5's magic __toString() method.

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

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

PHP: strval - Manual Home of Manuel PHP  Contents Haut

See Also

Find a PHP function
Error Infobrol

Can not display this page of the Infobrol website

Type of error (18-01)

Unknown format specifier "&"

Please try again in a few minutes…

Return to the home page




Steph