<?php $str = "luke"; echo preg_replace_callback('~^(?![eiux])[a-z]~', function($m) { return ucfirst($m[0]); }, $str); $str = "egg"; echo "\n" . preg_replace_callback('~^(?![eiux])[a-z]~', function($m) { return ucfirst($m[0]); }, $str);
You have javascript disabled. You will not be able to edit any code.