رتبه موضوع:
  • 0 رای - 0 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
مشکل با foreach
#1
سلام خدمت دوستان.
من پنج شش روزه درگیر این قضیه ام واقعا دیگه کارم به قرص اعصاب کشیده میشه.
من با file_get_content و لینکی که میزنم به این ارایه دسترسی پیدا میکنم که واقعا ساختارشو نمیفهمم.
نقل قول:{"26068":[{"name":"Graves's Tricksters","tier":"GOLD","queue":"RANKED_SOLO_5x5","entries":[{"playerOrTeamId":"35806143","playerOrTeamName":"Corrupt Onyx","division":"I","leaguePoints":0,"wins":13,"losses":12,"isHotStreak":false,"isVeteran":false,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"40460468","playerOrTeamName":"machin gunn","division":"III","leaguePoints":70,"wins":361,"losses":369,"isHotStreak":false,"isVeteran":true,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"42649682","playerOrTeamName":"DILDORR","division":"IV","leaguePoints":15,"wins":267,"losses":277,"isHotStreak":false,"isVeteran":true,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"34882881","playerOrTeamName":"Embry","division":"V","leaguePoints":0,"wins":136,"losses":145,"isHotStreak":false,"isVeteran":false,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"28463307","playerOrTeamName":"KingFu","division":"V","leaguePoints":0,"wins":48,"losses":70,"isHotStreak":false,"isVeteran":true,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"41252317","playerOrTeamName":"Villaforreal","division":"V","leaguePoints":0,"wins":315,"losses":344,"isHotStreak":false,"isVeteran":true,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"21765328","playerOrTeamName":"raphisaur","division":"I","leaguePoints":87,"wins":50,"losses":44,"isHotStreak":false,"isVeteran":false,"isFreshBlood":false,"isInactive":false,"miniSeries":{"target":3,"wins":0,"losses":1,"progress":"LNNNN"}},{"playerOrTeamId":"24555078","playerOrTeamName":"Cynegetic","division":"III","leaguePoints":57,"wins":53,"losses":50,"isHotStreak":false,"isVeteran":false,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"48069816","playerOrTeamName":"p0prox","division":"IV","leaguePoints":75,"wins":127,"losses":135,"isHotStreak":false,"isVeteran":true,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"20074187","playerOrTeamName":"KoreAn KonG","division":"I","leaguePoints":52,"wins":162,"losses":158,"isHotStreak":false,"isVeteran":false,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"22058362","playerOrTeamName":"iSteamBuns","division":"II","leaguePoints":19,"wins":454,"losses":490,"isHotStreak":false,"isVeteran":true,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"44512997","playerOrTeamName":"Clynes","division":"II","leaguePoints":72,"wins":44,"losses":47,"isHotStreak":false,"isVeteran":false,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"41192939","playerOrTeamName":"Arople","division":"V","leaguePoints":18,"wins":61,"losses":77,"isHotStreak":false,"isVeteran":true,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"39259564","playerOrTeamName":"TSM Fire","division":"II","leaguePoints":100,"wins":151,"losses":147,"isHotStreak":true,"isVeteran":true,"isFreshBlood":false,"isInactive":false,"miniSeries":{"target":2,"wins":1,"losses":0,"progress":"WNN"}},{"playerOrTeamId":"469864","playerOrTeamName":"Raseiko","division":"V","leaguePoints":0,"wins":18,"losses":11,"isHotStreak":true,"isVeteran":false,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"40834792","playerOrTeamName":"jkod1","division":"IV","leaguePoints":31,"wins":88,"losses":105,"isHotStreak":false,"isVeteran":true,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"30782471","playerOrTeamName":"DownSide","division":"IV","leaguePoints":66,"wins":258,"losses":294,"isHotStreak":false,"isVeteran":true,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"38320572","playerOrTeamName":"Kleisinger","division":"III","leaguePoints":50,"wins":164,"losses":159,"isHotStreak":false,"isVeteran":true,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"37261723","playerOrTeamName":"Alynn0x","division":"IV","leaguePoints":100,"wins":92,"losses":104,"isHotStreak":false,"isVeteran":true,"isFreshBlood":false,"isInactive":false,"miniSeries":{"target":2,"wins":1,"losses":1,"progress":"LWN"}},{"playerOrTeamId":"24316621","playerOrTeamName":"Neardim","division":"II","leaguePoints":68,"wins":35,"losses":44,"isHotStreak":false,"isVeteran":false,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"26550668","playerOrTeamName":"Supa Sexy GEM","division":"V","leaguePoints":28,"wins":17,"losses":16,"isHotStreak":false,"isVeteran":false,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"21373423","playerOrTeamName":"nugiwon","division":"II","leaguePoints":23,"wins":74,"losses":57,"isHotStreak":false,"isVeteran":false,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"23247989","playerOrTeamName":"GODKmiester","division":"V","leaguePoints":75,"wins":11,"losses":16,"isHotStreak":false,"isVeteran":false,"isFreshBlood":false,"isInactive":false},{"playerOrTeamId":"29318348","playerOrTeamName":"nDy","division":"V","leaguePoints":75,"wins":152,"losses":168,"isHotStreak":false,"isVeteran":true

که البته نصفشو گذاشتم.
در واقع به یه api رجوع میکنم و اینو بهم میده.
بعد به این صورت عمل میکنم ولی کار نمیده.
$result1 = file_get_contents(linkapi);
     $s = json_decode($result1);


foreach($s as $ps) {


echo ('<td>'. $ps['playerOrTeamId'] .'</td>');
echo ('<td>'. $ps['playerOrTeamName'] .'</td></tr>');

}

ولی جواب نمیده. Huh Ycry
پاسخ
تشکر شده توسط:




کاربران در حال بازدید این موضوع: 2 مهمان