How to show only one entry from the array.
$response = file_get_contents("http://api.vk.com/method/likes.getList?type=".$myrow["type"]."&owner_id=".$myrow["owner_id"]."&item_id=".$myrow["item_id"]."&filter=likes"); $resp = json_decode($response, true); if (!in_array($check_like, $resp['response']['users'])) { echo $myrow["id"]; } How to show $myrow["id"]; only once?
Here is the entire code:
$result = mysql_query( "SELECT * FROM vk_likes WHERE sex='0' AND country='0' AND user_age_from='0' AND user_age_to='100' AND (need_likes>there_likes) AND order_user_uid!='$check_like' "); $myrow = mysql_fetch_array($result); do { $response = file_get_contents("http://api.vk.com/method/likes.getList?type=".$myrow["type"]."&owner_id=".$myrow["owner_id"]."&item_id=".$myrow["item_id"]."&filter=likes"); $resp = json_decode($response, true); if (!in_array($check_like, $resp['response']['users'])) { echo $myrow["id"]; } } while($myrow = mysql_fetch_array($result));
ifblock, then it is necessary to writebreak;In general, if you have a large list, and the value is at the end, contact you will be banned for frequent access to the API - Alexei Shimansky