In my foreach, I see the following error:
Fatal error: Cannot use string offset as an array [..] on line 97
88. foreach ($response as $result) {
89. if($result['provider'] == 'Facebook') {
90. $provider = 'facebook';
91. }else{
92. $provider = 'twitter';
93. }
94. $user = array(
95. 'provider' => $result['provider'],
96. 'id' => $result['uid'],
97. 'name' => $result['info']['name'],
98. 'image' => $result['info']['image'],
99. 'link' => $result['info']['urls'][$provider],
100. );
101. echo "<h1>".$user['provider']."</h1>";
102. echo "<p>".$user['id']."</p>";
103. echo '<p><img src="'.$user['image'].'" /></p>';
105. echo "<p>".$user['name']."</p>";
106. echo "<p>".$user['link']."</p>";
107. }
I've tried reading around the web to understand what the problem is but it seems that some issues are unrelated to mine. I should also just come out with it and let you know I'm not that great with PHP. Can someone lend a hand?
P.S. I added break; after the last echo and that solved it but I don't think that's the way to go about it.
$result['info']. Probably doesn't contain what the code suggests it should.