Change option value in contact form 7

For change option value in contact form 7

function change_option_value_CF7_form_elements($html) {
function replace_include_blank($name, $text, &$html) {
$matches = false;
preg_match(‘/]*>(.*)/iU’, $html, $matches);
if ($matches) {
$select = str_replace(‘—‘, ” . $text . ”, $matches[0]);
$html = preg_replace(‘/]*>(.*)/iU’, $select, $html);
}
}
replace_include_blank(‘mc4wp-age’, ‘AGE*’, $html);
return $html;
}
add_filter(‘wpcf7_form_elements’, ‘change_option_value_CF7_form_elements’);