You are here: modifying link tags. « PHP Programming Language « IT news, forums, messages
modifying link tags.

Posted by elliott.linux on 11/15/11 11:53

ok what i need to do is modify all the link tags in a string from <a
href="blah.html"> to <a href="clicktrough.php?uri=blah.html> but the
problem is some of the tags have class so <a class="llama"
href="blah.html"> but i dont want to change all of the tags that
contain "href" because that would mess with the css. the code i am
using right now is
<?
$file = file_get_contents('http://kingcow.com/');
$llama = preg_split('/<a(.)*href=\"/', $file, -1, PREG_SPLIT_NO_EMPTY);
echo join("",$llama);
?>
this works but the problem is it removes the <a......>.

any help is grately appricated.

//elliott

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация