Answers for "php json to object to string"

PHP
1

object to string php

(string)$yourObject;
Posted by: Guest on September-12-2020
-1

convert stdclass to json in php

$stdClass = new stdClass();
$stdClass->name = "avatar";
$stdClass->age = 31;
$json_data = json_encode ((array) $stdClass);
print_r($json_data); //{"name":"avatar","age":31}
Posted by: Guest on July-27-2020

Code answers related to "php json to object to string"

Browse Popular Code Answers by Language