so i am working on a banned words list editor for my comments section

heres what I have
$wordlist will eventually become an external file

PHP Code:
<?php

//print a text box
function input_text($element_name$values){
    print 
'<input type="text" name="' $element_name .'" value="';
    print 
htmlentities($values) . '"/>';
}

//print a submit button
function input_submit($element_name$label){
    print 
'<input type="submit" name="' $element_name .'" value="';
    print 
htmlentities($label) . '"/>';
}

if(
$_POST['_submit_check']){
        if(
$form_errors validate_form()){
            
show_form($form_errors);
        } else {
            
process_form();
        }
    } else {
        
show_form();
    }
    
    
function 
show_form($errors '') {
$wordlist "crap:cr*p|dang:d*ng|shoot:sh**t";
$words explode('|'$wordlist);

foreach (
$words as $word){
    
$word explode(":",$word);
    
$new_words[($word[0])] = $word[1];
}

print 
'<form name="create" method="POST" action="'.htmlentities($_SERVER['PHP_SELF']). '"><br />'."\n";
$i 1;
foreach (
$new_words as $word => $replacement) {
   
input_text('a'.$i++, $word);
   print 
"\n \n";
   
input_text('a'.$i++, $replacement);
   print 
"\n<br />\n";

}
print 
"\n";
input_submit('submit''Submit');
print 
"\n";
print 
'<input type="hidden" name="_submit_check" value="1" />';
print 
"\n";
print 
'</form>';
}

function 
validate_form(){
//I will do this part later
}

function 
process_form(){
    
//HELP    
    
}

?>
what i want process_form to do is use the $_POST array to reconstitute the "badword:b*dw*rd|fart:f*rt" structure of the original world list, but i am lost on how to do it.

thanks for your help