Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (16 sloc) 0.409 kB
<?php
class Serializer {
public static function serialize($obj, $format='json') {
switch ($format) {
case 'json':
if(is_object($obj)){
$obj = get_object_vars($obj);
}
return json_encode($obj);
break;
default:
throw Exception('Format not supported');
}
}
}
?>
Jump to Line
Something went wrong with that request. Please try again.