Array_search returns false when it shouldn't (at least I think so)

<?php

echo "<pre>";

$myData = json_decode('{"matchId":3032493985,"region":"EUW","platformId":"EUW1","matchMode":"CLASSIC","matchType":"MATCHED_GAME","matchCreation":1485428949981,"matchDuration":2304,"queueType":"TEAM_BUILDER_RANKED_SOLO","mapId":11,"season":"PRESEASON2017","matchVersion":"7.2.173.3544","participants":[{"teamId":100,"spell1Id":4,"spell2Id":7,"championId":119,"highestAchievedSeasonTier":"MASTER","timeline":{"creepsPerMinDeltas":{"zeroToTen":7.3,"tenToTwenty":8.2,"twentyToThirty":4.8,"thirtyToEnd":7.2},"xpPerMinDeltas":{"zeroToTen":319.6,"tenToTwenty":431.6,"twentyToThirty":332.4,"thirtyToEnd":521.2},"goldPerMinDeltas":{"zeroToTen":245.2,"tenToTwenty":414.6,"twentyToThirty":278.8,"thirtyToEnd":554},"csDiffPerMinDeltas":{"zeroToTen":0.5,"tenToTwenty":-0.75,"twentyToThirty":-0.5,"thirtyToEnd":1.3},"xpDiffPerMinDeltas":{"zeroToTen":-9.4,"tenToTwenty":6.3,"twentyToThirty":-195.8,"thirtyToEnd":41.8},"damageTakenPerMinDeltas":{"zeroToTen":396.8,"tenToTwenty":463,"twentyToThirty":726.9,"thirtyToEnd":1061.8},"damageTakenDiffPerMinDeltas":{"zeroToTen":52.25,"tenToTwenty":-38.55,"twentyToThirty":247.85,"thirtyToEnd":-31.5},"role":"DUO_CARRY","lane":"BOTTOM"},"masteries":[{"masteryId":6111,"rank":5},{"masteryId":6122,"rank":1},{"masteryId":6131,"rank":5},{"masteryId":6143,"rank":1},{"masteryId":6151,"rank":5},{"masteryId":6161,"rank":1},{"masteryId":6211,"rank":5},{"masteryId":6222,"rank":1},{"masteryId":6231,"rank":5},{"masteryId":6241,"rank":1}],"stats":{"winner":true,"champLevel":16,"item0":3006,"item1":3031,"item2":1055,"item3":3094,"item4":3036,"item5":3142,"item6":3363,"kills":2,"doubleKills":0,"tripleKills":0,"quadraKills":0,"pentaKills":0,"unrealKills":0,"largestKillingSpree":0,"deaths":7,"assists":8,"totalDamageDealt":200285,"totalDamageDealtToChampions":15245,"totalDamageTaken":25232,"largestCriticalStrike":1312,"totalHeal":3983,"minionsKilled":259,"neutralMinionsKilled":6,"neutralMinionsKilledTeamJungle":3,"neutralMinionsKilledEnemyJungle":3,"goldEarned":15045,"goldSpent":13730,"combatPlayerScore":0,"objectivePlayerScore":0,"totalPlayerScore":0,"totalScoreRank":0,"magicDamageDealtToChampions":258,"physicalDamageDealtToChampions":14855,"trueDamageDealtToChampions":132,"visionWardsBoughtInGame":0,"sightWardsBoughtInGame":0,"magicDamageDealt":1645,"physicalDamageDealt":195937,"trueDamageDealt":2702,"magicDamageTaken":6100,"physicalDamageTaken":18852,"trueDamageTaken":278,"firstBloodKill":false,"firstBloodAssist":false,"firstTowerKill":false,"firstTowerAssist":false,"firstInhibitorKill":true,"firstInhibitorAssist":false,"inhibitorKills":1,"towerKills":3,"wardsPlaced":9,"wardsKilled":8,"largestMultiKill":1,"killingSprees":0,"totalUnitsHealed":4,"totalTimeCrowdControlDealt":98},"participantId":1,"runes":[{"runeId":5245,"rank":9},{"runeId":5289,"rank":9},{"runeId":5317,"rank":9},{"runeId":5337,"rank":3}]},{"teamId":100,"spell1Id":12,"spell2Id":4,"championId":68,"highestAchievedSeasonTier":"CHALLENGER","timeline":{"creepsPerMinDeltas":{"zeroToTen":7.2,"tenToTwenty":6.7,"twentyToThirty":6.8,"thirtyToEnd":3},"xpPerMinDeltas":{"zeroToTen":423.5,"tenToTwenty":460,"twentyToThirty":421.8,"thirtyToEnd":345.6},"goldPerMinDeltas":{"zeroToTen":245,"tenToTwenty":410.9,"twentyToThirty":302.8,"thirtyToEnd":346.8},"csDiffPerMinDeltas":{"zeroToTen":-1.9,"tenToTwenty":-1.2,"twentyToThirty":-2.4,"thirtyToEnd":1.2},"xpDiffPerMinDeltas":{"zeroToTen":-86.4,"tenToTwenty":-36.1,"twentyToThirty":-307.9,"thirtyToEnd":-75.8},"damageTakenPerMinDeltas":{"zeroToTen":315.9,"tenToTwenty":864.5,"twentyToThirty":955.3,"thirtyToEnd":1664.2},"damageTakenDiffPerMinDeltas":{"zeroToTen":129.6,"tenToTwenty":278.4,"twentyToThirty":92.2,"thirtyToEnd":103.8},"role":"SOLO","lane":"TOP"},"masteries":[{"masteryId":6114,"rank":5},{"masteryId":6122,"rank":1},{"masteryId":6134,"rank":5},{"masteryId":6142,"rank":1},{"masteryId":6154,"rank":5},{"masteryId":6164,"rank":1},{"masteryId":6211,"rank":5},{"masteryId":6223,"rank":1},{"masteryId":6232,"rank":5},{"masteryId":6241,"rank":1}],"stats":{"winner":true,"champLevel":18,"item0":3020,"item1":3157,"item2":3151,"item3":3135,"item4":1058,"item5":1026,"item6":3340,"kills":5,"doubleKills":1,"tripleKills":0,"quadraKills":0,"pentaKills":0,"unrealKills":0,"largestKillingSpree":3,"deaths":9,"assists":12,"totalDamageDealt":189785,"totalDamageDealtToChampions":32927,"totalDamageTaken":33600,"largestCriticalStrike":0,"totalHeal":1666,"minionsKilled":245,"neutralMinionsKilled":28,"neutralMinionsKilledTeamJungle":20,"neutralMinionsKilledEnemyJungle":8,"goldEarned":14587,"goldSpent":13150,"combatPlayerScore":0,"objectivePlayerScore":0,"totalPlayerScore":0,"totalScoreRank":0,"magicDamageDealtToChampions":32193,"physicalDamageDealtToChampions":658,"trueDamageDealtToChampions":75,"visionWardsBoughtInGame":2,"sightWardsBoughtInGame":0,"magicDamageDealt":174889,"physicalDamageDealt":14264,"trueDamageDealt":631,"magicDamageTaken":10525,"physicalDamageTaken":22566,"trueDamageTaken":508,"firstBloodKill":false,"firstBloodAssist":false,"firstTowerKill":false,"firstTowerAssist":false,"firstInhibitorKill":false,"firstInhibitorAssist":false,"inhibitorKills":0,"towerKills":0,"wardsPlaced":20,"wardsKilled":5,"largestMultiKill":2,"killingSprees":1,"totalUnitsHealed":1,"totalTimeCrowdControlDealt":729},"participantId":2,"runes":[{"runeId":5273,"rank":9},{"runeId":5289,"rank":9},{"runeId":5316,"rank":3},{"runeId":5317,"rank":6},{"runeId":5357,"rank":3}]},{"teamId":100,"spell1Id":3,"spell2Id":4,"championId":16,"highestAchievedSeasonTier":"PLATINUM","timeline":{"creepsPerMinDeltas":{"zeroToTen":0.5,"tenToTwenty":0.6,"twentyToThirty":0.4,"thirtyToEnd":0},"xpPerMinDeltas":{"zeroToTen":220.6,"tenToTwenty":288.8,"twentyToThirty":289.6,"thirtyToEnd":621},"goldPerMinDeltas":{"zeroToTen":150.5,"tenToTwenty":299.4,"twentyToThirty":214,"thirtyToEnd":371.6},"csDiffPerMinDeltas":{"zeroToTen":0.5,"tenToTwenty":-0.75,"twentyToThirty":-0.5,"thirtyToEnd":1.3},"xpDiffPerMinDeltas":{"zeroToTen":-9.4,"tenToTwenty":6.3,"twentyToThirty":-195.8,"thirtyToEnd":41.8},"damageTakenPerMinDeltas":{"zeroToTen":232.3,"tenToTwenty":252.2,"twentyToThirty":833.3,"thirtyToEnd":1017.6},"damageTakenDiffPerMinDeltas":{"zeroToTen":52.25,"tenToTwenty":-38.55,"twentyToThirty":247.85,"thirtyToEnd":-31.5},"role":"DUO_SUPPORT","lane":"BOTTOM"},"masteries":[{"masteryId":6211,"rank":5},{"masteryId":6223,"rank":1},{"masteryId":6231,"rank":5},{"masteryId":6242,"rank":1},{"masteryId":6311,"rank":5},{"masteryId":6322,"rank":1},{"masteryId":6332,"rank":5},{"masteryId":6342,"rank":1},{"masteryId":6352,"rank":5},{"masteryId":6363,"rank":1}],"stats":{"winner":true,"champLevel":14,"item0":3107,"item1":2049,"item2":3190,"item3":3301,"item4":1001,"item5":3504,"item6":3364,"kills":3,"doubleKills":0,"tripleKills":0,"quadraKills":0,"pentaKills":0,"unrealKills":0,"largestKillingSpree":2,"deaths":6,"assists":15,"totalDamageDealt":14950,"totalDamageDealtToChampions":5648,"totalDamageTaken":20531,"largestCriticalStrike":0,"totalHeal":30516,"minionsKilled":16,"neutralMinionsKilled":0,"neutralMinionsKilledTeamJungle":0,"neutralMinionsKilledEnemyJungle":0,"goldEarned":10408,"goldSpent":9250,"combatPlayerScore":0,"objectivePlayerScore":0,"totalPlayerScore":0,"totalScoreRank":0,"magicDamageDealtToChampions":3082,"physicalDamageDealtToChampions":703,"trueDamageDealtToChampions":1862,"visionWardsBoughtInGame":2,"sightWardsBoughtInGame":0,"magicDamageDealt":8344,"physicalDamageDealt":2949,"trueDamageDealt":3655,"magicDamageTaken":7232,"physicalDamageTaken":13196,"trueDamageTaken":102,"firstBloodKill":false,"firstBloodAssist":false,"firstTowerKill":false,"firstTowerAssist":false,"firstInhibitorKill":false,"firstInhibitorAssist":false,"inhibitorKills":0,"towerKills":0,"wardsPlaced":29,"wardsKilled":8,"largestMultiKill":1,"killingSprees":1,"totalUnitsHealed":7,"totalTimeCrowdControlDealt":217},"participantId":3,"runes":[{"runeId":5257,"rank":9},{"runeId":5289,"rank":9},{"runeId":5315,"rank":9},{"runeId":5347,"rank":3}]},{"teamId":100,"spell1Id":11,"spell2Id":4,"championId":121,"highestAchievedSeasonTier":"MASTER","timeline":{"creepsPerMinDeltas":{"zeroToTen":0.1,"tenToTwenty":2.1,"twentyToThirty":4.7,"thirtyToEnd":6.8},"xpPerMinDeltas":{"zeroToTen":331.6,"tenToTwenty":537.6,"twentyToThirty":527.6,"thirtyToEnd":502},"goldPerMinDeltas":{"zeroToTen":246.2,"tenToTwenty":455.9,"twentyToThirty":410.9,"thirtyToEnd":416.4},"csDiffPerMinDeltas":{"zeroToTen":-0.8,"tenToTwenty":1.7,"twentyToThirty":2,"thirtyToEnd":5.4},"xpDiffPerMinDeltas":{"zeroToTen":-32.1,"tenToTwenty":14.6,"twentyToThirty":15.9,"thirtyToEnd":5.2},"damageTakenPerMinDeltas":{"zeroToTen":615.3,"tenToTwenty":728.4,"twentyToThirty":1336.5,"thirtyToEnd":860},"damageTakenDiffPerMinDeltas":{"zeroToTen":-104,"tenToTwenty":-120.9,"twentyToThirty":589,"thirtyToEnd":-964.4},"role":"NONE","lane":"JUNGLE"},"masteries":[{"masteryId":6114,"rank":5},{"masteryId":6121,"rank":1},{"masteryId":6134,"rank":5},{"masteryId":6142,"rank":1},{"masteryId":6312,"rank":5},{"masteryId":6323,"rank":1},{"masteryId":6331,"rank":4},{"masteryId":6332,"rank":1},{"masteryId":6343,"rank":1},{"masteryId":6351,"rank":5},{"masteryId":6362,"rank":1}],"stats":{"winner":true,"champLevel":18,"item0":3814,"item1":3147,"item2":1412,"item3":3071,"item4":1031,"item5":3047,"item6":3364,"kills":10,"doubleKills":1,"tripleKills":0,"quadraKills":0,"pentaKills":0,"unrealKills":0,"largestKillingSpree":6,"deaths":4,"assists":8,"totalDamageDealt":229441,"totalDamageDealtToChampions":22673,"totalDamageTaken":37089,"largestCriticalStrike":0,"totalHeal":14270,"minionsKilled":119,"neutralMinionsKilled":100,"neutralMinionsKilledTeamJungle":69,"neutralMinionsKilledEnemyJungle":31,"goldEarned":15918,"goldSpent":15000,"combatPlayerScore":0,"objectivePlayerScore":0,"totalPlayerScore":0,"totalScoreRank":0,"magicDamageDealtToChampions":2490,"physicalDamageDealtToChampions":19538,"trueDamageDealtToChampions":644,"visionWardsBoughtInGame":5,"sightWardsBoughtInGame":0,"magicDamageDealt":3867,"physicalDamageDealt":211691,"trueDamageDealt":13882,"magicDamageTaken":11285,"physicalDamageTaken":25346,"trueDamageTaken":457,"firstBloodKill":false,"firstBloodAssist":false,"firstTowerKill":false,"firstTowerAssist":false,"firstInhibitorKill":false,"firstInhibitorAssist":false,"inhibitorKills":0,"towerKills":2,"wardsPlaced":11,"wardsKilled":13,"largestMultiKill":2,"killingSprees":2,"totalUnitsHealed":1,"totalTimeCrowdControlDealt":566},"participantId":4,"runes":[{"runeId":5245,"rank":9},{"runeId":5295,"rank":6},{"runeId":5296,"rank":3},{"runeId":5316,"rank":5},{"runeId":5317,"rank":4},{"runeId":5335,"rank":2},{"runeId":5347,"rank":1}]},{"teamId":100,"spell1Id":4,"spell2Id":12,"championId":39,"highestAchievedSeasonTier":"CHALLENGER","timeline":{"creepsPerMinDeltas":{"zeroToTen":7.9,"tenToTwenty":10.6,"twentyToThirty":6.7,"thirtyToEnd":10},"xpPerMinDeltas":{"zeroToTen":471,"tenToTwenty":613,"twentyToThirty":545.1,"thirtyToEnd":806.8},"goldPerMinDeltas":{"zeroToTen":327.9,"tenToTwenty":479.8,"twentyToThirty":504.8,"thirtyToEnd":566.6},"csDiffPerMinDeltas":{"zeroToTen":1.5,"tenToTwenty":3.6,"twentyToThirty":2.1,"thirtyToEnd":6.2},"xpDiffPerMinDeltas":{"zeroToTen":87.4,"tenToTwenty":209.4,"twentyToThirty":102.8,"thirtyToEnd":307.8},"damageTakenPerMinDeltas":{"zeroToTen":611.9,"tenToTwenty":572,"twentyToThirty":1611.7,"thirtyToEnd":2181},"damageTakenDiffPerMinDeltas":{"zeroToTen":144,"tenToTwenty":-231.2,"twentyToThirty":715.5,"thirtyToEnd":1357.2},"role":"SOLO","lane":"MIDDLE"},"masteries":[{"masteryId":6111,"rank":5},{"masteryId":6122,"rank":1},{"masteryId":6134,"rank":5},{"masteryId":6143,"rank":1},{"masteryId":6312,"rank":5},{"masteryId":6323,"rank":1},{"masteryId":6331,"rank":5},{"masteryId":6343,"rank":1},{"masteryId":6351,"rank":5},{"masteryId":6361,"rank":1}],"stats":{"winner":true,"champLevel":18,"item0":3748,"item1":3153,"item2":3026,"item3":3078,"item4":3006,"item5":3155,"item6":3340,"kills":13,"doubleKills":0,"tripleKills":0,"quadraKills":0,"pentaKills":0,"unrealKills":0,"largestKillingSpree":5,"deaths":3,"assists":9,"totalDamageDealt":289260,"totalDamageDealtToChampions":35992,"totalDamageTaken":44344,"largestCriticalStrike":0,"totalHeal":15214,"minionsKilled":323,"neutralMinionsKilled":26,"neutralMinionsKilledTeamJungle":15,"neutralMinionsKilledEnemyJungle":11,"goldEarned":18792,"goldSpent":16658,"combatPlayerScore":0,"objectivePlayerScore":0,"totalPlayerScore":0,"totalScoreRank":0,"magicDamageDealtToChampions":4360,"physicalDamageDealtToChampions":25477,"trueDamageDealtToChampions":6155,"visionWardsBoughtInGame":3,"sightWardsBoughtInGame":0,"magicDamageDealt":17079,"physicalDamageDealt":233429,"trueDamageDealt":38751,"magicDamageTaken":14517,"physicalDamageTaken":29413,"trueDamageTaken":413,"firstBloodKill":false,"firstBloodAssist":false,"firstTowerKill":false,"firstTowerAssist":false,"firstInhibitorKill":false,"firstInhibitorAssist":true,"inhibitorKills":0,"towerKills":0,"wardsPlaced":20,"wardsKilled":10,"largestMultiKill":1,"killingSprees":4,"totalUnitsHealed":1,"totalTimeCrowdControlDealt":444},"participantId":5,"runes":[{"runeId":5245,"rank":9},{"runeId":5289,"rank":9},{"runeId":5317,"rank":9},{"runeId":5337,"rank":3}]},{"teamId":200,"spell1Id":4,"spell2Id":12,"championId":38,"highestAchievedSeasonTier":"DIAMOND","timeline":{"creepsPerMinDeltas":{"zeroToTen":6.4,"tenToTwenty":7,"twentyToThirty":4.6,"thirtyToEnd":3.8},"xpPerMinDeltas":{"zeroToTen":383.6,"tenToTwenty":403.6,"twentyToThirty":442.3,"thirtyToEnd":499},"goldPerMinDeltas":{"zeroToTen":230.2,"tenToTwenty":361.1,"twentyToThirty":456.9,"thirtyToEnd":374},"csDiffPerMinDeltas":{"zeroToTen":-1.5,"tenToTwenty":-3.6,"twentyToThirty":-2.1,"thirtyToEnd":-6.2},"xpDiffPerMinDeltas":{"zeroToTen":-87.4,"tenToTwenty":-209.4,"twentyToThirty":-102.8,"thirtyToEnd":-307.8},"damageTakenPerMinDeltas":{"zeroToTen":467.9,"tenToTwenty":803.2,"twentyToThirty":896.2,"thirtyToEnd":823.8},"damageTakenDiffPerMinDeltas":{"zeroToTen":-144,"tenToTwenty":231.2,"twentyToThirty":-715.5,"thirtyToEnd":-1357.2},"role":"SOLO","lane":"MIDDLE"},"masteries":[{"masteryId":6114,"rank":5},{"masteryId":6122,"rank":1},{"masteryId":6134,"rank":5},{"masteryId":6142,"rank":1},{"masteryId":6312,"rank":5},{"masteryId":6323,"rank":1},{"masteryId":6331,"rank":5},{"masteryId":6343,"rank":1},{"masteryId":6351,"rank":5},{"masteryId":6362,"rank":1}],"stats":{"winner":false,"champLevel":17,"item0":3157,"item1":1026,"item2":3027,"item3":3020,"item4":3100,"item5":1058,"item6":3363,"kills":6,"doubleKills":0,"tripleKills":0,"quadraKills":0,"pentaKills":0,"unrealKills":0,"largestKillingSpree":2,"deaths":10,"assists":6,"totalDamageDealt":126740,"totalDamageDealtToChampions":23579,"totalDamageTaken":34277,"largestCriticalStrike":0,"totalHeal":6135,"minionsKilled":206,"neutralMinionsKilled":1,"neutralMinionsKilledTeamJungle":0,"neutralMinionsKilledEnemyJungle":1,"goldEarned":14284,"goldSpent":13575,"combatPlayerScore":0,"objectivePlayerScore":0,"totalPlayerScore":0,"totalScoreRank":0,"magicDamageDealtToChampions":22058,"physicalDamageDealtToChampions":1496,"trueDamageDealtToChampions":25,"visionWardsBoughtInGame":1,"sightWardsBoughtInGame":0,"magicDamageDealt":102776,"physicalDamageDealt":23939,"trueDamageDealt":25,"magicDamageTaken":9843,"physicalDamageTaken":21594,"trueDamageTaken":2839,"firstBloodKill":false,"firstBloodAssist":false,"firstTowerKill":false,"firstTowerAssist":false,"firstInhibitorKill":false,"firstInhibitorAssist":false,"inhibitorKills":0,"towerKills":0,"wardsPlaced":9,"wardsKilled":3,"largestMultiKill":1,"killingSprees":2,"totalUnitsHealed":1,"totalTimeCrowdControlDealt":197},"participantId":6,"runes":[{"runeId":5273,"rank":9},{"runeId":5289,"rank":9},{"runeId":5316,"rank":9},{"runeId":5357,"rank":3}]},{"teamId":200,"spell1Id":4,"spell2Id":11,"championId":64,"highestAchievedSeasonTier":"PLATINUM","timeline":{"creepsPerMinDeltas":{"zeroToTen":0.9,"tenToTwenty":0.4,"twentyToThirty":2.7,"thirtyToEnd":1.4},"xpPerMinDeltas":{"zeroToTen":363.7,"tenToTwenty":523,"twentyToThirty":511.7,"thirtyToEnd":496.8},"goldPerMinDeltas":{"zeroToTen":281.9,"tenToTwenty":387,"twentyToThirty":428.2,"thirtyToEnd":420.6},"csDiffPerMinDeltas":{"zeroToTen":0.8,"tenToTwenty":-1.7,"twentyToThirty":-2,"thirtyToEnd":-5.4},"xpDiffPerMinDeltas":{"zeroToTen":32.1,"tenToTwenty":-14.6,"twentyToThirty":-15.9,"thirtyToEnd":-5.2},"damageTakenPerMinDeltas":{"zeroToTen":719.3,"tenToTwenty":849.3,"twentyToThirty":747.5,"thirtyToEnd":1824.4},"damageTakenDiffPerMinDeltas":{"zeroToTen":104,"tenToTwenty":120.9,"twentyToThirty":-589,"thirtyToEnd":964.4},"role":"NONE","lane":"JUNGLE"},"masteries":[{"masteryId":6111,"rank":5},{"masteryId":6121,"rank":1},{"masteryId":6134,"rank":5},{"masteryId":6142,"rank":1},{"masteryId":6311,"rank":5},{"masteryId":6321,"rank":1},{"masteryId":6331,"rank":5},{"masteryId":6341,"rank":1},{"masteryId":6351,"rank":5},{"masteryId":6362,"rank":1}],"stats":{"winner":false,"champLevel":17,"item0":2055,"item1":1408,"item2":3143,"item3":3071,"item4":3742,"item5":3047,"item6":3364,"kills":6,"doubleKills":0,"tripleKills":0,"quadraKills":0,"pentaKills":0,"unrealKills":0,"largestKillingSpree":3,"deaths":5,"assists":8,"totalDamageDealt":210956,"totalDamageDealtToChampions":14792,"totalDamageTaken":36747,"largestCriticalStrike":0,"totalHeal":9841,"minionsKilled":57,"neutralMinionsKilled":153,"neutralMinionsKilledTeamJungle":88,"neutralMinionsKilledEnemyJungle":65,"goldEarned":14635,"goldSpent":13225,"combatPlayerScore":0,"objectivePlayerScore":0,"totalPlayerScore":0,"totalScoreRank":0,"magicDamageDealtToChampions":2567,"physicalDamageDealtToChampions":11649,"trueDamageDealtToChampions":576,"visionWardsBoughtInGame":6,"sightWardsBoughtInGame":0,"magicDamageDealt":43501,"physicalDamageDealt":155599,"trueDamageDealt":11856,"magicDamageTaken":12060,"physicalDamageTaken":22607,"trueDamageTaken":2079,"firstBloodKill":false,"firstBloodAssist":false,"firstTowerKill":false,"firstTowerAssist":true,"firstInhibitorKill":false,"firstInhibitorAssist":false,"inhibitorKills":0,"towerKills":0,"wardsPlaced":26,"wardsKilled":7,"largestMultiKill":1,"killingSprees":1,"totalUnitsHealed":1,"totalTimeCrowdControlDealt":963},"participantId":7,"runes":[{"runeId":5245,"rank":9},{"runeId":5290,"rank":3},{"runeId":5295,"rank":6},{"runeId":5317,"rank":9},{"runeId":5335,"rank":3}]},{"teamId":200,"spell1Id":4,"spell2Id":12,"championId":126,"highestAchievedSeasonTier":"MASTER","timeline":{"creepsPerMinDeltas":{"zeroToTen":9.1,"tenToTwenty":7.9,"twentyToThirty":9.2,"thirtyToEnd":1.8},"xpPerMinDeltas":{"zeroToTen":509.9,"tenToTwenty":496.1,"twentyToThirty":729.7,"thirtyToEnd":421.4},"goldPerMinDeltas":{"zeroToTen":341,"tenToTwenty":463.7,"twentyToThirty":681.8,"thirtyToEnd":331.4},"csDiffPerMinDeltas":{"zeroToTen":1.9,"tenToTwenty":1.2,"twentyToThirty":2.4,"thirtyToEnd":-1.2},"xpDiffPerMinDeltas":{"zeroToTen":86.4,"tenToTwenty":36.1,"twentyToThirty":307.9,"thirtyToEnd":75.8},"damageTakenPerMinDeltas":{"zeroToTen":186.3,"tenToTwenty":586.1,"twentyToThirty":863.1,"thirtyToEnd":1560.4},"damageTakenDiffPerMinDeltas":{"zeroToTen":-129.6,"tenToTwenty":-278.4,"twentyToThirty":-92.2,"thirtyToEnd":-103.8},"role":"SOLO","lane":"TOP"},"masteries":[{"masteryId":6114,"rank":5},{"masteryId":6121,"rank":1},{"masteryId":6134,"rank":5},{"masteryId":6142,"rank":1},{"masteryId":6312,"rank":5},{"masteryId":6323,"rank":1},{"masteryId":6331,"rank":5},{"masteryId":6343,"rank":1},{"masteryId":6351,"rank":5},{"masteryId":6361,"rank":1}],"stats":{"winner":false,"champLevel":18,"item0":3053,"item1":3071,"item2":3033,"item3":3111,"item4":3142,"item5":3072,"item6":3363,"kills":9,"doubleKills":2,"tripleKills":0,"quadraKills":0,"pentaKills":0,"unrealKills":0,"largestKillingSpree":7,"deaths":5,"assists":10,"totalDamageDealt":235573,"totalDamageDealtToChampions":38646,"totalDamageTaken":27318,"largestCriticalStrike":0,"totalHeal":4965,"minionsKilled":292,"neutralMinionsKilled":8,"neutralMinionsKilledTeamJungle":4,"neutralMinionsKilledEnemyJungle":4,"goldEarned":18216,"goldSpent":17625,"combatPlayerScore":0,"objectivePlayerScore":0,"totalPlayerScore":0,"totalScoreRank":0,"magicDamageDealtToChampions":6046,"physicalDamageDealtToChampions":32487,"trueDamageDealtToChampions":112,"visionWardsBoughtInGame":5,"sightWardsBoughtInGame":0,"magicDamageDealt":25113,"physicalDamageDealt":209624,"trueDamageDealt":836,"magicDamageTaken":10487,"physicalDamageTaken":15621,"trueDamageTaken":1208,"firstBloodKill":false,"firstBloodAssist":false,"firstTowerKill":true,"firstTowerAssist":false,"firstInhibitorKill":false,"firstInhibitorAssist":false,"inhibitorKills":0,"towerKills":4,"wardsPlaced":17,"wardsKilled":4,"largestMultiKill":2,"killingSprees":2,"totalUnitsHealed":1,"totalTimeCrowdControlDealt":383},"participantId":8,"runes":[{"runeId":5245,"rank":9},{"runeId":5290,"rank":9},{"runeId":5317,"rank":9},{"runeId":5335,"rank":3}]},{"teamId":200,"spell1Id":7,"spell2Id":4,"championId":202,"highestAchievedSeasonTier":"MASTER","timeline":{"creepsPerMinDeltas":{"zeroToTen":6.4,"tenToTwenty":9.1,"twentyToThirty":5.4,"thirtyToEnd":2.8},"xpPerMinDeltas":{"zeroToTen":269.8,"tenToTwenty":453.8,"twentyToThirty":525.6,"thirtyToEnd":593.6},"goldPerMinDeltas":{"zeroToTen":292.2,"tenToTwenty":421.2,"twentyToThirty":468.6,"thirtyToEnd":359.8},"csDiffPerMinDeltas":{"zeroToTen":-0.5,"tenToTwenty":0.75,"twentyToThirty":0.5,"thirtyToEnd":-1.3},"xpDiffPerMinDeltas":{"zeroToTen":9.4,"tenToTwenty":-6.3,"twentyToThirty":195.8,"thirtyToEnd":-41.8},"damageTakenPerMinDeltas":{"zeroToTen":223.9,"tenToTwenty":459.2,"twentyToThirty":480.4,"thirtyToEnd":665.8},"damageTakenDiffPerMinDeltas":{"zeroToTen":-52.25,"tenToTwenty":38.55,"twentyToThirty":-247.85,"thirtyToEnd":31.5},"role":"DUO_CARRY","lane":"BOTTOM"},"masteries":[{"masteryId":6114,"rank":5},{"masteryId":6121,"rank":1},{"masteryId":6131,"rank":1},{"masteryId":6134,"rank":4},{"masteryId":6143,"rank":1},{"masteryId":6151,"rank":5},{"masteryId":6164,"rank":1},{"masteryId":6211,"rank":5},{"masteryId":6223,"rank":1},{"masteryId":6231,"rank":5},{"masteryId":6241,"rank":1}],"stats":{"winner":false,"champLevel":17,"item0":3142,"item1":3139,"item2":3094,"item3":3158,"item4":3031,"item5":0,"item6":3363,"kills":5,"doubleKills":1,"tripleKills":0,"quadraKills":0,"pentaKills":0,"unrealKills":0,"largestKillingSpree":2,"deaths":7,"assists":14,"totalDamageDealt":216385,"totalDamageDealtToChampions":34179,"totalDamageTaken":18878,"largestCriticalStrike":1400,"totalHeal":2382,"minionsKilled":231,"neutralMinionsKilled":17,"neutralMinionsKilledTeamJungle":11,"neutralMinionsKilledEnemyJungle":6,"goldEarned":15247,"goldSpent":14695,"combatPlayerScore":0,"objectivePlayerScore":0,"totalPlayerScore":0,"totalScoreRank":0,"magicDamageDealtToChampions":5796,"physicalDamageDealtToChampions":28383,"trueDamageDealtToChampions":0,"visionWardsBoughtInGame":1,"sightWardsBoughtInGame":0,"magicDamageDealt":13382,"physicalDamageDealt":202768,"trueDamageDealt":234,"magicDamageTaken":7511,"physicalDamageTaken":10653,"trueDamageTaken":713,"firstBloodKill":true,"firstBloodAssist":false,"firstTowerKill":false,"firstTowerAssist":false,"firstInhibitorKill":false,"firstInhibitorAssist":false,"inhibitorKills":0,"towerKills":0,"wardsPlaced":16,"wardsKilled":0,"largestMultiKill":2,"killingSprees":1,"totalUnitsHealed":2,"totalTimeCrowdControlDealt":198},"participantId":9,"runes":[{"runeId":5253,"rank":9},{"runeId":5289,"rank":3},{"runeId":5296,"rank":6},{"runeId":5317,"rank":9},{"runeId":5335,"rank":3}]},{"teamId":200,"spell1Id":4,"spell2Id":3,"championId":43,"highestAchievedSeasonTier":"CHALLENGER","timeline":{"creepsPerMinDeltas":{"zeroToTen":0.4,"tenToTwenty":1.2,"twentyToThirty":0.8,"thirtyToEnd":1.8},"xpPerMinDeltas":{"zeroToTen":289.2,"tenToTwenty":254,"twentyToThirty":488,"thirtyToEnd":465},"goldPerMinDeltas":{"zeroToTen":196.7,"tenToTwenty":292.7,"twentyToThirty":410.6,"thirtyToEnd":410.4},"csDiffPerMinDeltas":{"zeroToTen":-0.5,"tenToTwenty":0.75,"twentyToThirty":0.5,"thirtyToEnd":-1.3},"xpDiffPerMinDeltas":{"zeroToTen":9.4,"tenToTwenty":-6.3,"twentyToThirty":195.8,"thirtyToEnd":-41.8},"damageTakenPerMinDeltas":{"zeroToTen":300.7,"tenToTwenty":333.1,"twentyToThirty":584.1,"thirtyToEnd":1476.6},"damageTakenDiffPerMinDeltas":{"zeroToTen":-52.25,"tenToTwenty":38.55,"twentyToThirty":-247.85,"thirtyToEnd":31.5},"role":"DUO_SUPPORT","lane":"BOTTOM"},"masteries":[{"masteryId":6211,"rank":5},{"masteryId":6221,"rank":1},{"masteryId":6232,"rank":5},{"masteryId":6241,"rank":1},{"masteryId":6311,"rank":5},{"masteryId":6322,"rank":1},{"masteryId":6332,"rank":5},{"masteryId":6342,"rank":1},{"masteryId":6352,"rank":5},{"masteryId":6363,"rank":1}],"stats":{"winner":false,"champLevel":15,"item0":3504,"item1":2055,"item2":3107,"item3":2301,"item4":3190,"item5":3117,"item6":3364,"kills":3,"doubleKills":0,"tripleKills":0,"quadraKills":0,"pentaKills":0,"unrealKills":0,"largestKillingSpree":2,"deaths":6,"assists":16,"totalDamageDealt":35448,"totalDamageDealtToChampions":13121,"totalDamageTaken":23067,"largestCriticalStrike":0,"totalHeal":9316,"minionsKilled":34,"neutralMinionsKilled":0,"neutralMinionsKilledTeamJungle":0,"neutralMinionsKilledEnemyJungle":0,"goldEarned":12497,"goldSpent":11000,"combatPlayerScore":0,"objectivePlayerScore":0,"totalPlayerScore":0,"totalScoreRank":0,"magicDamageDealtToChampions":9278,"physicalDamageDealtToChampions":2795,"trueDamageDealtToChampions":1047,"visionWardsBoughtInGame":8,"sightWardsBoughtInGame":0,"magicDamageDealt":25656,"physicalDamageDealt":7495,"trueDamageDealt":2297,"magicDamageTaken":6237,"physicalDamageTaken":14801,"trueDamageTaken":2028,"firstBloodKill":false,"firstBloodAssist":false,"firstTowerKill":false,"firstTowerAssist":false,"firstInhibitorKill":false,"firstInhibitorAssist":false,"inhibitorKills":0,"towerKills":1,"wardsPlaced":35,"wardsKilled":13,"largestMultiKill":1,"killingSprees":1,"totalUnitsHealed":8,"totalTimeCrowdControlDealt":288},"participantId":10,"runes":[{"runeId":5245,"rank":9},{"runeId":5289,"rank":6},{"runeId":5301,"rank":3},{"runeId":5315,"rank":5},{"runeId":5317,"rank":4},{"runeId":5347,"rank":1},{"runeId":5357,"rank":2}]}],"participantIdentities":[{"participantId":1,"player":{"summonerId":21609001,"summonerName":"piss elo ad","matchHistoryUri":"\/v1\/stats\/player_history\/EUW1\/25188670","profileIcon":518}},{"participantId":2,"player":{"summonerId":21112717,"summonerName":"WhiteKnight108","matchHistoryUri":"\/v1\/stats\/player_history\/EUW1\/24522980","profileIcon":542}},{"participantId":3,"player":{"summonerId":28547832,"summonerName":"Asharii","matchHistoryUri":"\/v1\/stats\/player_history\/EUW1\/32276489","profileIcon":20}},{"participantId":4,"player":{"summonerId":27426799,"summonerName":"Taikki","matchHistoryUri":"\/v1\/stats\/player_history\/EUN1\/28800621","profileIcon":5}},{"participantId":5,"player":{"summonerId":71500,"summonerName":"Wickd","matchHistoryUri":"\/v1\/stats\/player_history\/EUW1\/76833","profileIcon":1211}},{"participantId":6,"player":{"summonerId":19097444,"summonerName":"V \u00f5 N","matchHistoryUri":"\/v1\/stats\/player_history\/EUW1\/21759276","profileIcon":1376}},{"participantId":7,"player":{"summonerId":23307330,"summonerName":"66J ","matchHistoryUri":"\/v1\/stats\/player_history\/EUW1\/27434572","profileIcon":7}},{"participantId":8,"player":{"summonerId":44246839,"summonerName":"Magnus Carls\u00ebn","matchHistoryUri":"\/v1\/stats\/player_history\/EUW1\/202849816","profileIcon":1383}},{"participantId":9,"player":{"summonerId":94397375,"summonerName":"Mephiix v2","matchHistoryUri":"\/v1\/stats\/player_history\/EUN1\/217256825","profileIcon":23}},{"participantId":10,"player":{"summonerId":19538899,"summonerName":"PSG Steve","matchHistoryUri":"\/v1\/stats\/player_history\/EUW1\/22311863","profileIcon":542}}],"teams":[{"teamId":100,"winner":true,"firstBlood":false,"firstTower":false,"firstInhibitor":true,"firstBaron":false,"firstDragon":true,"firstRiftHerald":true,"towerKills":8,"inhibitorKills":1,"baronKills":0,"dragonKills":3,"riftHeraldKills":1,"vilemawKills":0,"dominionVictoryScore":0,"bans":[{"championId":107,"pickTurn":1},{"championId":7,"pickTurn":3},{"championId":143,"pickTurn":5}]},{"teamId":200,"winner":false,"firstBlood":true,"firstTower":true,"firstInhibitor":false,"firstBaron":true,"firstDragon":false,"firstRiftHerald":false,"towerKills":6,"inhibitorKills":0,"baronKills":2,"dragonKills":1,"riftHeraldKills":0,"vilemawKills":0,"dominionVictoryScore":0,"bans":[{"championId":164,"pickTurn":2},{"championId":136,"pickTurn":4},{"championId":13,"pickTurn":6}]}]}', true);


if ($myData) echo 'Yep, $myData is valid.<br />';

$myId = 71500;

$x = array_search($myId, array_column($myData["participantIdentities"], "summonerId"));

echo "Required data: " . $myData["participantIdentities"][$x]["participantId"] . ", expected: 5.<br />";
echo "<br />";
echo '$x stands for: ' . (($x === true) ? "bool(true)" : (($x === false)) ? "bool(false)" : "custom: $x");

?>

Actually outputs:

Yep, $myData is valid.
Required data: 1, expected: 5.

$x stands for: bool(false)

It gives me wrong ID, and I don’t know why.

because the array you search is not the one you expect.

Could you clarify?

print_r($myData["participantIdentities"]);

What’s wrong with it? I think it’s supposed to show this. That’s the array it’s supposed to find items in. Could you point out what’s wrong?

for me it works as expected. participantId:71500 does not exist, so $x is false, which converts to 0, participantID of key 0 is 1.

My bad, but changing it to summonerId doesn’t solve it.

$x = array_search($myId, array_column($myData["participantIdentities"], "summonerId"));

Somewhere in $myData["participantIdentities"] there is summonerId. Select array where their summonerId == 75000 and return index.

$x still returns false.

“Somewhere in” is not really a very good spec.

$myData = 'long json string';
$summonerIds = [];
foreach($myData["participantIdentities"] as $partId) {
    $summonerIds[] = $partId['player']['summonerId'];
}
var_dump($summonerIds);

And take a moment to read what array_search actually returns: http://php.net/manual/en/function.array-search.php

Hint: it will never return true.

exactly … somewhere … but array_column() and array_search() only work on the first level

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.