September 2001
Intermediate to advanced
768 pages
32h 45m
English
string strval(mixed value) Converts a value to a string.
Returns:
String value of the given value
Description:
strval() converts any scalar value (string, integer, or double) to a string. Resource pointers passed to this function are converted to a string such as "Resource ID #1". If conversion of an array or object is attempted, the function only returns the type name of the value being converted (array and object, respectively).
Due to PHP’s dynamic typing, use of strval() is almost never required. In most contexts where a scalar value should be a string, the value will simply act like a string. For example:
$double = 2.2; $string = "I am a string "; // The value of $double is used as a string - no explicit conversion is required ...
Read now
Unlock full access