SyntaxFix
Write A Post
Hire A Developer
Questions
In the simplest cases type hinting should work:
$json = json_encode( (array)$object );