...

View Full Version : Resolved filtering text



cosmicsea
03-17-2010, 07:41 AM
Hi im using this code right here to remove the word "(text)" from ever appearing in my seo tag links.

<?php
$tobeOmitted=array('(text)');
$tagss = explode(" ", $link['display_name']);
foreach( $tagss as $key => $value){
if(!in_array($value,$tobeOmitted))
echo "<a href=\"/search/$value\"/>$value</a> ";
} ?>
What im trying to do now is filter underscores "_" from ever appearing. So lets say there is the text link showing as "text_link". What can i add to remove the "_" from the text and make "text_link" explode into 2 seperate links such as "text" and "link"? the word "text_link" is just an example and that word could be any random words. Can somebody help me?

MattF
03-17-2010, 09:46 AM
$tagss = explode(" ", str_replace('_', ' ', $link['display_name']));

cosmicsea
03-17-2010, 01:19 PM
$tagss = explode(" ", str_replace('_', ' ', $link['display_name']));


Thanks alot. :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum