bigtimslim Posted April 22, 2008 Share Posted April 22, 2008 Can someone tell me why with the code below I get a bunch of extra blank lines above the output. The more items in the feed the more whitespace. <?php $city = 'Redlands'; $state = 'CA'; $industry = 'Technology'; $s = simplexml_load_file('http://hotjobs.yahoo.com/job-rss-l-' . $city . '-' . $state . '-c-' . $industry); $c = 0; echo '<table width="550px">'; foreach ($s->channel->item as $item) { ($c % 2 == 0) ? $color = '#cac9e6' : $color = '#f5f5ff'; echo '<tr bgcolor=' . $color . '><td><b><a href="' . $item->link . '">' . $item->title . '</a></b></td><td rowspan="2">' . $item->pubDate . '</td></tr>'; echo '<tr bgcolor=' . $color . '><td>' . $item->description . '</td></tr><br /><br />'; $c++; } echo '</table>'; ?> Link to comment https://forums.phpfreaks.com/topic/102251-solved-simplexml-and-extra-lines/ Share on other sites More sharing options...
bigtimslim Posted April 22, 2008 Author Share Posted April 22, 2008 Also, what is that function that will correct those funky characters output in the titles that should show up as long dashes? Link to comment https://forums.phpfreaks.com/topic/102251-solved-simplexml-and-extra-lines/#findComment-523549 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.