Hi,
Ok im tryin to build a DB off acronym's and their definition's so i can use it to search though articles for acronyms (ie: PHP) and replace them with the corresponding acronym tag (ie: <acronym title="PHP hypertext preprocessor">PHP</acronym>)
so whats the problem? the problem is that i want all my acronyms in an associative array like so
$acronyms = array(
'html' => 'Hypertext Markup Language',
'php' => 'PHP Hypertext Preprocessor',
'xml' => 'Extensible Markup language',
);
but i want the associative array to be generated dynamicly from the values im getting from a string that im exploding like so. (this code puts them into arrays but associative array's are wot puzzle me)
<?
$string_2xplode = 'HTML[+]HyperText Markup Language[-]
PHP[+]PHP hypertext preprocessor[-]
CSS[+]Cascading Sylesheets[-] ';
$str_buff = explode('[-]',$string_2xplode);
$acronym_count= (count($str_buff)-2);
for($i=0;$i<=$acronym_count;$i++){
$str_buff1 = explode('[+]',$str_buff[$i]);
$acc[$i] = $str_buff1[0];
$acc_def[$i] = $str_buff1[1];
}
for($i=0;$i<=$acronym_count;$i++){
echo $acc[$i].' : '.$acc_def[$i].'<br>';
}
?>
can some1 please help me?