Featured
- Get link
- X
- Other Apps
PHP | strval() Function
The strval() function is an inbuilt function in PHP and is used to convert any scalar value (string, integer, or double) to a string. We cannot use strval() on arrays or on object, if applied then this function only returns the type name of the value being converted.
Syntax:
strval( $variable )
Parameter: This function accepts a single parameter $variable. This parameter represents the value which we want to convert to string
Return value: This function returns a string. This string is generated by typecasting the value of the variable passed to it as a parameter.
Below programs illustrate the strval() function.
code 1
edit
play_arrow
brightness_4
<?php
$var_name
= 32.360;
// prints the value of above variable
// as a string
echo
strval
(
$var_name
);
?>
- Get link
- X
- Other Apps
Comments
Post a Comment