<?php $text='this PART should be CONVERTED to uppercase [This PART should not BE changed] this part should also be CONVERTED to uppercase [THIS part should also not be CHANGED] etc..'; $text = preg_replace_callback( "/(\[(.*?)\])(*SKIP)(*FAIL)|./is", function($m) { return strtoupper($m[0]); }, $text); $text = str_replace(array('[', ']'), '', $text); echo $text;
You have javascript disabled. You will not be able to edit any code.