Jump to content

[SOLVED] simplexml and extra lines


bigtimslim

Recommended Posts

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

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.