php Modify Strings

From w3schools.com, Experiment by Teeratus_R

Upper Case

The strtoupper() function returns the string in upper case:

HELLO WORLD!

Lower Case

The strtolower() function returns the string in lower case:

hello world!

Replace String

The str_replace() function replaces some characters with some other characters in a string.

Hello Dolly!

Reverse a String

The PHP strrev() function reverses a string.

!dlroW olleH

Remove Whitespace

Whitespace is the space before and/or after the actual text, and very often you want to remove this space.

Hello World!
Hello World!