YardalGedal
@YardalGedal
yeah boy

Почему Parse error: syntax error, unexpected 'if' (T_IF)?

function get($owner_id,$offset) {
$get = 'https://api.vk.com/method/wall.get?owner_id='.$owner_id.'&count=1&offset='.$offset;
$get = json_decode(file_get_contents($get),true);
if($get['response'][1]['id'] <> file_get_contents("base/vk_".$owner_id.".txt")) {
file_put_contents("base/vk_".$owner_id.".txt", $get['response'][1]['id'])

if (count($get['response'][1]['attachments']) >= "2") {
for ($i = 0; $i <= count($get['response'][1]['attachments'])-1; $i++) {
send("&#13;",6,'photo'.$get['response'][1]['attachments'][$i]['photo']['owner_id'].'_'.$get['response'][1]['attachments'][$i]['photo']['pid']);
};
} 
else 
{
send("&#13;",6,'photo'.$get['response'][1]['attachment']['photo']['owner_id'].'_'.$get['response'][1]['attachment']['photo']['pid']);
};
};
}


Ругается на "If" в 7-й строке ошибкой Parse error: syntax error, unexpected 'if' (T_IF) -- как устранить? :)
  • Вопрос задан
  • 5772 просмотра
Решения вопроса 1
@IceJOKER
Web/Android developer
после
file_put_contents("base/vk_".$owner_id.".txt", $get['response'][1]['id'])
забыли ;
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы