how do you call a function inside a foreach statement
===

I am trying to use foreach statment to run through a function that preg_replaces using regular expression. Can someone help, because my method doesn't work..

    $reg_sent is an array
    
    function reg_sent($i){
    		$reg_sent = "/[^A-Za-z0-9.,\n\r ]/";
    		return preg_replace($reg_sent, '', $i);
    	}
    
        **foreach($reg_sent as $key=>$value){
        		$value = reg_sent($value);
        	}**
        	