Hi,
Im trying to make a script that reads $string_of_words and replaces all the accronyms (specified in the $accronyms_list) with somthing like..
<accronym name="hypertext markup language">HTML</accronym>
this was my attempt that failed misaribly...
<?
$string_of_words = 'this is a string that contains accronyms like php , html and xml';
$accronym_list = array('html', 'php', 'xml');
$accronym_defs = array('HyperText Markup Language',
'php hypertext preprocessor',
'extensible Markup language'
);
for($i=0;$i<=(count($accronym_list)-1);$i++){
$new_string = str_replace(
$accronym_list[$i], '
<accronym name="'.$accronym_defs[$i].'">'. $accronym_list[$i].'</accronym>',$string_of_words);
}
echo $new_string;
?>
Im Really stuck on this hope it makes sense... plz help :S