How can I swap around / toggle the case of the characters in a string, for example:
$str = \"Hello, My Name is Tom\";
After I run the code
If your string is ASCII only, you can use XOR:
$str = "Hello, My Name is Tom"; print strtolower($str) ^ strtoupper($str) ^ $str;
Outputs:
hELLO, mY nAME IS tOM