Answers for "php arrray of objects to string conversion"

PHP
5

Array to String Conversion in PHP

$gadget = array( 'computer', 'mobile', 'tablet' );
echo implode($arr);
Posted by: Guest on July-05-2020
1

array to string conversion in php

$person = [
    'name' => 'Jon',
    'age' => 26,
    'status' => null,
    'friends' => ['Matt', 'Kaci', 'Jess']
];

echo json_encode($person);
// {"name":"Jon","age":26,"status":null,"friends":["Matt","Kaci","Jess"]}
Posted by: Guest on November-05-2020

Browse Popular Code Answers by Language