Answers for "php array cast to strin"

PHP
4

array to string php

<?php

$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);

echo $comma_separated; 

// lastname,email,phone


?>
Posted by: Guest on November-24-2021
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
1

convert to string php

echo "'$animal'";
Posted by: Guest on January-27-2021

Browse Popular Code Answers by Language