Query: strval
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
STRVAL(3) 1 STRVAL(3) strval - Get string value of a variableSYNOPSISstring strval (mixed $var)DESCRIPTIONGet 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(3) or number_format(3).PARAMETERSo $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(3) on arrays or on objects that do not implement the __toString() method.RETURN VALUESThe string value of $var.EXAMPLESExample #1 strval(3) example using PHP 5's magic __toString() method. <?php class StrValTest { public function __toString() { return __CLASS__; } } // Prints 'StrValTest' echo strval(new StrValTest); ?>SEE ALSOboolval(3), floatval(3), intval(3), settype(3), sprintf(3), number_format(3), Type juggling, __toString(). PHP Documentation Group STRVAL(3)
Related Man Pages |
---|
strval(3) - php |
ktaglib_id3v2_attachedpictureframe(3) - php |
boolval(3) - php |
is_scalar(3) - php |
reflectionfunction(3) - php |
Similar Topics in the Unix Linux Community |
---|
$var -ne ${var} why? |
ksh : find value type |
Find exact string |
Difference between $var and ${var} |
passing object to function, columns class |