Anonymous user / 3.145.119.199 Log In Register
?
Wallet: 3.00
Daily Credits:
1.20 / 1.20

PHP Functions Online


strval

(PHP 4, PHP 5)

strvalGet string value of a variable

string strval(mixed $var)

Checkout ? #

Item Description Item Price Your Price
Total

Preview #

${{ variable.param.name }} = {{ variable.param|getValue:variable.form:true }};
{{ call.result}} = ;

Description #

string strval ( mixed $var )

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.

Return Values #

The string value of var.

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);
?>

See Also #