Sun Oct 26, 2008 10:20 pm
<html>
<head>
<title>preg_replace</title>
</head>
<body>
<?php
$string = "<a href=\"http://www.codemiles.com/\">codemiles</a><br />";
$pattern = '/<a[ .]*?(href *= *".*?").*?>(.*?)<\/a>/i';
$replacement = '\2: <a \1>\1</a>';
$string = preg_replace($pattern, $replacement, $string);
print($string);
?>
</body>
</html>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.