Jump to content

fbords

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

fbords's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i may be explaining this incorrectly. if so, i apologize, I'm still learning. the above example works for: $r = $test->getSummonerByName($summoner_name); but i would like to be able to use it for: $r = $test->getSummoner($summoner_id,'masteries'); "Masteries" is a nested property within $summoner_id. I'm trying to use kicken's decode method to echo the information but it won't work.
  2. any input on this?
  3. I see. That's what I'm looking to do. What about functions with additional properties like: $r = $test->getSummoner($summoner_id,'masteries'); How would i go about accessing the "masteries" properties? The following wont work. I can't quite get the syntax right: $r = $test->getSummoner($summoner_id,'masteries'); $r = json_decode($r, true); foreach ($r as $theirname=>$details){ echo $theirname."\r\n"; echo "Masteries: ".$details['masteries']."\r\n"; }
  4. the problem is likely with my lack of expertise on the subject. My issue is pertaining to the formatting of the results that are returned. The function dumps all of the requested data, I am looking to be able to selectively choose the data displayed. So instead of it returning: {"username":{"id":585897,"name":"TheirName","profileIconId":642,"summonerLevel":30,"revisionDate":1405652924000}} I would like to choose to just show the username, id, name, etc.
  5. Hi all, I am working with the following 2 page script: https://github.com/kevinohashi/php-riot-api. All works well and the data is pulled via the API as intended. However, depending on the data I'm trying to display on screen, the object contains multiple values. For example: $r = $test->getSummoner($summoner_id,'name'); print_r($r); outputs their ID and name: {"585897":"TheirName"} Just as the following: $r = $test->getSummonerByName($summoner_name); print_r($r); outputs username, ID, Name, profile icon ID, level, and timestamp: {"theirname":{"id":585897,"name":"TheirName","profileIconId":642,"summonerLevel":30,"revisionDate":1405652924000}} Depending on which function I am calling (on example.php), I would like to be able to split the values so I can echo them throughout a page: Name: <value> ID: <value> Level: <value> etc... Any guidance would be appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.