phpeter Posted October 8, 2010 Share Posted October 8, 2010 Here's my code: $file_string .= ($feed_id == 1 ? '<a><<</a>' : '<a href="#' . $feed_id-1 . '"><<</a>'); $file_string .= ($article_id == 1 ? '<a><</a>' : '<a href="#' . $article_id-1 . '"><</a>'); $file_string .= ($article_id == count($xml->channel->item) ? '<a>></a>' : '<a href="#' . $article_id-1 . '">></a>'); $file_string .= ($feed_id == count($xml->channel->item) ? '<a>>></a>' : '<a href="#' . $feed_id-1 . '">>></a>'); Why is it showing up as "<<<Engadget• -1">>-1">>>"? I was thinking it was something wrong with the "$var-1" part. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
jl5501 Posted October 8, 2010 Share Posted October 8, 2010 I would insert a space before the - so it is clearly seen as a minus Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 8, 2010 Share Posted October 8, 2010 Enclose the math operations in parentheses also. Quote Link to comment Share on other sites More sharing options...
phpeter Posted October 8, 2010 Author Share Posted October 8, 2010 That fixed it, thanks guys! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.