Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Hide sensitive information from the default User class and returns data in json format
require_once( 'parse/parse.php' );
$parseQuery = new parseQuery('_User');
$result = $parseQuery->find();
foreach ( $result->results as $user ) {
unset( $user->email );
if ( isset( $user->authData->facebook ) ) {
unset( $user->authData->facebook->access_token );
// display the final data in json format
echo json_encode( $result );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment