I want to convert an object to a string in PHP. Specifically, I am trying to execute a response to a mysql query, and I am trying to convert it to something that I can write to a file and use later.
Of course, when you try to write an object to a file, PHP screams correctly: Cheated fatal error: an object of class DB_result cannot be converted to a string in .....
Alternatively, if there is another way to write the result of the mysql query to a file, this also works. I play with a home caching project :)
source share