PHP strval() Function

P
PHP unserialize() Function
PHP settype() Function

In this article, you will learn how to get the string value of the variable in PHP. The strval() function in PHP returns the string value of a variable.

what is the syntax of the STRVAL() function in php?

strval(variable);
ParametersDetails
variableRequired. Specifies the variable to check
PHP STRVAL() method

examples of the STRVAL() function

Example 1. In this example, we return the string value of different variables.

<?php
$a = "Hello";
echo strval($a) . "<br>";

$b = "1234.56789";
echo strval($b) . "<br>";

$c = "1234.56789Hello";
echo strval($c) . "<br>";

$d = "Hello1234.56789";
echo strval($d) . "<br>";

$e = 1234;
echo strval($e) . "<br>";
?>
PHP unserialize() Function
PHP settype() Function

Add comment

Tutor Network

Share this

Learn PHP from A to Z