Jump to content

Unexpected semicolon error, anyone know why?


phpeter

Recommended Posts

I'm getting this error:

 

PHP Parse error:  syntax error, unexpected ';' in [...] on line 44

 

This is line 44:

 

 

$file_string .= ($article_id == count($xml->channel->item) ? '<a>></a>' : '<a href="#' . $article_id-1 . '">></a>';

 

 

EDIT: Nevermind, I found it! The parenthesis at the end, duh.

You need to surround your math with parenthesis, and you're missing a parenthesis to end your conditional statement.

 

$file_string .= ($article_id == count($xml->channel->item)) ? '<a>></a>' : '<a href="#' . ($article_id-1) . '">></a>';

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.