Hello everyone, there is such code:
<?php $poisk = 229786213; $row = file('fren.txt'); foreach ($row as $key => $value) { $baza = json_decode(file_get_contents("https://api.vk.com/method/friends.get?user_id=".$value."&access_token=0$token&v=5.80")); if(isset($baza->response->items)){ $array = $baza ->response->items; $key = array_search($poisk, $array); // $key = 2; if($key != FALSE){ $fp = fopen("counter.txt", "a+"); $mytext = "$value \r\n"; $test = fwrite($fp, $mytext); fclose($fp); echo "Good"; } } } ?> How to make so that foreach retained all values, and not just the last?