M
M
Max Payne2015-02-04 22:37:58
PHP
Max Payne, 2015-02-04 22:37:58

Why 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']);
};
};
}

Swears at "If" in the 7th line with Parse error: syntax error, unexpected 'if' (T_IF) -- how to fix it? :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IceJOKER, 2015-02-04
@YardalGedal

after

file_put_contents("base/vk_".$owner_id.".txt", $get['response'][1]['id'])
forgot;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question