What kind of empty element?

So. I get IDS of groups of user, and generates the references to the group and for the grant of a token. The code itself is below :
<?php
session_start();
 $groups_get = json_decode(file_get_contents("https://api.vk.com/method/groups.get?filter=admin&extended=1&access_token={$_SESSION['utoken']}"));
 foreach ($groups_get--->response as $groups_array) {
 $gid = $groups_array->gid;
 $gname = $groups_array->name;
 $gphoto = $groups_array->photo;
 $gphoto_src = "<img src="$gphoto">";
 $gid_url = "<a href="http://vk.com/club" . $gid . "">$gname</a>";
 $grant_url = "<a href="https://oauth.vk.com/authorize?client_id=6018117&scope=manage,messages,photos,docs&redirect_uri=http://new.vhost25708.cpsite.ru/access/groups&response_type=code&group_ids=" . $gid . "">To grant</a>";
 echo $gid_url . '<br>';
 echo $grant_url . '<br>';
 echo $gphoto_src . '<br>';
 $_SESSION['gid'] = $gid;
}
 ?>

Then deduce on HTML page it all. And in the output I see the following :42fb490ad9f64f778df4e1ebd2945679.png

What is that link at the top to Give the law, and it is the wrong URL which should not be in principle. Climb into the page code and I see there the following :
<div class="bots">
 <a href="http://vk.com/club"></a><br><a href="https://oauth.vk.com/authorize?client_id=6018117&scope=manage,messages,photos,docs&redirect_uri=http://new.vhost25708.cpsite.ru/access/groups&response_type=code&group_ids=">to Grant rights</a><br><img src><br><a href="http://vk.com/club142342685">Foxy Bot | Create a bot (Beta)</a><br><a href="https://oauth.vk.com/authorize?client_id=6018117&scope=manage,messages,photos,docs&redirect_uri=http://new.vhost25708.cpsite.ru/access/groups&response_type=code&group_ids=142342685">to Grant rights</a><br><img src="https://pp.userapi.com/c837226/v837226447/37d83/0HoKk2bVjqg.jpg"><br><a href="http://vk.com/club145826725">FoxyWeb - 145826725</a><br><a href="https://oauth.vk.com/authorize?client_id=6018117&scope=manage,messages,photos,docs&redirect_uri=http://new.vhost25708.cpsite.ru/access/groups&response_type=code&group_ids=145826725">to Grant rights</a><br><img src="https://vk.com/images/community_50.png"><br><a href="http://vk.com/club145511947">BetaEasyBot</a><br><a href="https://oauth.vk.com/authorize?client_id=6018117&scope=manage,messages,photos,docs&redirect_uri=http://new.vhost25708.cpsite.ru/access/groups&response_type=code&group_ids=145511947">to Grant rights</a><br><img src="https://vk.com/images/community_50.png"><br> 
 </div>


Well, everything in principle seems like it should, BUT this alarming line :
<a href="http://vk.com/club"></a><br><a href="https://oauth.vk.com/authorize?client_id=6018117&scope=manage,messages,photos,docs&redirect_uri=http://new.vhost25708.cpsite.ru/access/groups&response_type=code&group_ids=">to Grant rights</a><br><img src><br>


After all, it is neither the group ID nor the address on her avatar O_o (Well that is understandable, because the group only 3) so then that bit of code is unnecessary as it seem to fit in here at all? Can you explain how to remove it without damaging the rest of the code?
June 26th 19 at 14:25
1 answer
June 26th 19 at 14:27
like that.
$gid_url = "<a href="http://vk.com/club" . $gid . "">$gname</a>";

check that the API returns

Find more questions by tags PHP