<?php
function tr_ucwords($cumle) {
    $cumle = tr_toLower ( $cumle );
    if (preg_match_all ( '/(?P<i>(?:[ıİğĞüÜşŞöÖçÇ]|[^\s\n]))(?P<k>(?:[ıİğĞüÜşŞöÖçÇ]|[^\s\n]){0,})/siu', $cumle, $sonuc, PREG_PATTERN_ORDER )) {
        $cumle = "";
        foreach ( $sonuc ['i'] as $a => $harf ) {
            $cumle .= tr_toUpper ( $harf ) . $sonuc ['k'] [$a] . " ";
        }
    }
    return $cumle;
}
function tr_toUpper($cumle) {
    return strtoupper ( str_replace ( array ('ı', 'i', 'ğ', 'ü', 'ş', 'ö', 'ç' ), array ('I', 'İ', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç' ), $cumle ) );
}
function tr_toLower($cumle) {
    return strtolower ( str_replace ( array ('I', 'İ', 'Ğ', 'Ü', 'Ş', 'Ö', 'Ç' ), array ('ı', 'i', 'ğ', 'ü', 'ş', 'ö', 'ç' ), $cumle ) );
}
?>