<?php 
    function convert($keyword) {
       $wResult = preg_match_all('/(^I|[[:upper:]]{2,}|[[:upper:]][[:lower:]]*|[[:lower:]]+|\d+|#)/u', $keyword, $matches);
       return implode(' ',$matches[0]);
    }

 $search_keyword = array(
            "comeHEREtomorrow",
            "KissYouTODAY",
            "comeÜndeHere",
            "NEVERSAYIT",
            "2013willCome",
            "Before2013ends",
            "IKnowThat",
            "#whatiknow"
        );
        $need_keyword = array(
            "come HERE tomorrow",
            "Kiss You TODAY",
            "come Ünde Here",
            "NEVERSAYIT",
            "2013 will Come",
            "Before 2013 ends",
            "I Know That",
            "# whatiknow"
        );     

        foreach ($search_keyword as $key => $w) {
            $wExpected = $need_keyword[$key];

            $wResult = convert($w);

            $check = strcmp($wExpected, $wResult);
            $checkWord = ( $check == 0 ? "SUCCESS" : "FAILURE" );

            echo "try $key,\t keyword: \"$w\" expected: \"$wExpected\" result: \"$wResult\" check: $check ($checkWord),\n";
        }
?>