PHP JSON Class Routines

Post Thumbnail of PHP JSON Class Routines
 PHP, Programming         No comments   

Recently whilst working on a project, I needed a method of returning JSON from a class based on it’s public variables.  The routines are not perfect and may need work but if used correctly issues shouldn’t occur.
Class To JSON

function class_to_json($input)
{
if($input)
{
$class_vars = get_object_vars($input);

EXULT designed by ZENVERSE  |  In conjunction with Reseller Hosting from the #1 Web Hosting Provider - HostNexus.