Asked 7 years ago
28 Dec 2016
Views 1028

posted

Object of class serialize could not be converted to string in unserialize - Php

using code belowed

class config{
   var $databasename = "test";
   var $username = "root";
   var $password = "root";
}
$config =new config();
echo $serialized_output= serialize($config);

good untill

echo unserialize($data);

give error

Catchable fatal error: Object of class config could not be converted to string
Post Answer