Answers for "how to turn a variable into a string php"

PHP
1

php convert to string

<?php
class StrValTest
{
    public function __toString()
    {
        return __CLASS__;
    }
}

// Prints 'StrValTest'
echo strval(new StrValTest);
?>
Posted by: Guest on April-02-2020

Code answers related to "how to turn a variable into a string php"

Browse Popular Code Answers by Language