All pastes #899936 Raw Edit

Unnamed

public php v1 · immutable
·published 2008-02-11 15:19 UTC
rendered paste body
				<?php	/*	Here, we'll loop through all of the items in the feed, and $item represents the current item in the loop.	*/        function contains_badwords($item, $badwords)        {                foreach ($badwords as $badword)                {                        if (stripos($item->get_title(), $badword) !== false || stripos($item->get_description(), $badword) !== false)                        {                                return true;                        }                }                return false;        }       foreach ($news->get_items(0, 5) as $item):                if (contains_badwords($item, array('sex', 'drugs', 'rock', 'roll'))): ?>			<div>				<h3><a href="<?php echo $item->get_permalink(); ?>"target="_blank"><?php echo $item->get_title(); ?></a></h3>				<p><?php echo $item->get_date('j M Y | g:i a T'); ?></p>				<p><?php echo $item->get_description(); ?></p>				<p></p>				<div class="break"> </div>			</div>			<?php endforeach; ?>