...

View Full Version : Resolved removing keyword



cosmicsea
01-14-2010, 12:35 PM
im using this code right here on some automated links of mine for seo to explode the caption of the links but i want to be able to make one word that is in the links that explodes into its own link to not show.

<?php $tagss = explode(" ", $link['display_name']);
foreach( $tagss as $key => $value){
echo "<a href=\"/search/$value\"/>$value</a> ";
} ?>

lets say the link caption is "automated link caption". the code above explodes that into 3 seperate links. link 1 "automated" link 2 "link" link 3 "caption". so now that you see what im talking about how can i make one of those not display? lets say i dont want "caption" to ever display. how would i do that? Can anyone help? thanks.

abduraooft
01-14-2010, 12:42 PM
$tobeOmitted=array('caption','something');
foreach( $tagss as $key => $value){
if(!in_array($value,$tobeOmitted))
echo "<a href=\"/search/$value\"/>$value</a> ";
}?

cosmicsea
01-14-2010, 12:50 PM
$tobeOmitted=array('caption','something');
foreach( $tagss as $key => $value){
if(!in_array($value,$tobeOmitted))
echo "<a href=\"/search/$value\"/>$value</a> ";
}?

that doesn't seem to be working.
"actually hold on i just noticed a typo when i entered the code. i will reply in a minute".

cosmicsea
01-14-2010, 12:54 PM
ok, It does work and it works great! thanks alot! :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum