1. Function description
The strval() function is a built-in function in PHP that is used to convert any standard value (string, integer or double) to a string. We cannot use strval in array or object. If used, this function simply returns the type name of the value that needs to be converted.
2. Grammar
string strval (mixed $var)
3. Parameter description
$var: can be any scalar type, but not an array or object.
4. Return value
Return a string.
5. Examples
<?php$int_str= 123;var_dump($int_str);$str = strval(123);var_dump($str);?> int(123)string(3) "123"
The above is the use of strval() function in PHP. I hope it will be helpful to everyone.