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! Link to comment https://forums.phpfreaks.com/topic/215393-weird-script-output/ 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 Link to comment https://forums.phpfreaks.com/topic/215393-weird-script-output/#findComment-1120168 Share on other sites More sharing options...
Pikachu2000 Posted October 8, 2010 Share Posted October 8, 2010 Enclose the math operations in parentheses also. Link to comment https://forums.phpfreaks.com/topic/215393-weird-script-output/#findComment-1120171 Share on other sites More sharing options...
phpeter Posted October 8, 2010 Author Share Posted October 8, 2010 That fixed it, thanks guys! Link to comment https://forums.phpfreaks.com/topic/215393-weird-script-output/#findComment-1120307 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.