elunap
elunap

Reputation: 841

Parse Php Get current user information

in javascript when I wanted to get any column of the current user I simply used:

Parse.User.current().get("anything");

In Php I don't know how to do it, and i could't find anything in the docs, can some one explain to me how to do it? thanks.

I was able to convert the Parse object to an array, but I still cant get the information because I don't know how to apply the syntax, When I print the array i get this:

Array ( [*_sessionToken] => r:mRy6rpWrsIQe4Yf86YWlxu4nC [*serverData] => Array ( [Tipo] => Burger [name] => Burger Lab [username] => burgerlab ) [*operationSet] => Array ( ) [Parse\ParseObjectestimatedData] => Array ( [type] => Burger [name] => Burger Lab [username] => burgerlab ) [Parse\ParseObjectdataAvailability] => Array ( [type] => 1 [name] => 1 [sessionToken] => 1 [username] => 1 ) [Parse\ParseObjectclassName] => _User [Parse\ParseObjectobjectId] => 6J6RDBXLoU [Parse\ParseObjectcreatedAt] => DateTime Object ( [date] => 2015-10-23 04:21:57.147000 [timezone_type] => 2 [timezone] => Z ) [Parse\ParseObjectupdatedAt] => DateTime Object ( [date] => 2015-10-23 04:22:10.390000 [timezone_type] => 2 [timezone] => Z ) [Parse\ParseObjecthasBeenFetched] => 1 )

I'm trying to get the "name" value, I tried using:

$array["name"] 

But it doesn't work, how can I know the index?

Solved: This is how I got the value:

$username=ParseUser::getCurrentUser()->get("name");

Upvotes: 0

Views: 568

Answers (2)

elunap
elunap

Reputation: 841

Solved: This is how I got the value:

$username=ParseUser::getCurrentUser()->get("name");

Upvotes: 1

NYassuki
NYassuki

Reputation: 23

yes very unclear question, but i assume you you will be parsing a multidimensional array, if so, you can start here : http://php.net/manual/en/language.types.array.php

Upvotes: 0

Related Questions