Here you go, you could quite easily create a function for this...
PHP Code:
<?php
$aAttorneys = array(
1 => 'Michael Anderson',
2 => 'Tom A. Atkinson',
3 => 'Pat M. Boyer'
);
$sString = 'We have top attorneys such as, Michael Anderson, Tom A. Atkinson & Pat M. Boyer in our employ.';
foreach($aAttorneys as $iId => $sAttorney)
{
$sString = str_replace(
$sAttorney,
sprintf(
'<a href="bio.php?id=%s">%s</a>',
$iId,
$sAttorney
),
$sString
);
}
echo $sString;
#We have top attorneys such as, <a href="bio.php?id=1">Michael Anderson</a>, <a href="bio.php?id=2">Tom A. Atkinson</a> & <a href="bio.php?id=3">Pat M. Boyer</a> in our employ.
?>
Bookmarks