0

I have some filters on my forums, something like: when a user posts "hello" the filter modifies the word to "ohai!".

But when a user posts Hello the filter still modify the word to "ohai!", not "Ohai!".

I know this is fixed using regex, but I don't know how.

4

1 回答 1

1

如果你使用 PHP,你可以使用 ucfirst(); (大写首字母)

例如:

$filter= "ohai";
echo ucfirst($filter);
于 2012-10-26T14:10:36.317 回答