<?php echo preg_replace_callback( '~(^\pL+\b)|(\b\p{Lu}+\b)~u', function($m) { return $m[1] ? mb_convert_case($m[1], MB_CASE_TITLE, 'UTF-8') : mb_strtolower($m[2], 'UTF-8'); }, 'THIS IS A Sentence that should be TAKEN Care of' );
You have javascript disabled. You will not be able to edit any code.