0

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");
2
  • This question is very unclear, please add more details informing us what you are trying to achieve. Commented Oct 26, 2015 at 4:06
  • In my User class, I have the column, beside of the defaults ones, "name", so I'm trying to get that information (of current user), as I mention in the post, with java is pretty simple, but I don't quit get it in php. Commented Oct 26, 2015 at 4:40

2 Answers 2

1

Solved: This is how I got the value:

$username=ParseUser::getCurrentUser()->get("name");
Sign up to request clarification or add additional context in comments.

Comments

0

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

1 Comment

Updated, I used your idea, but I don't know how to go on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.