Skip to content

Instantly share code, notes, and snippets.

Created December 8, 2017 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3c14d80951979c79a183604804e6f9c8 to your computer and use it in GitHub Desktop.
Save anonymous/3c14d80951979c79a183604804e6f9c8 to your computer and use it in GitHub Desktop.
<?php
$user = Doctrine_Query::create()
->select('u.id, u.username, u.firstname, u.lastname')
->from('User u')
->orderby('u.id')
->execute();
$userArray = $user->toArray();
$json = json_encode($userArray);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment