Home / PHP Tips Generated By ChatGPT / Reversing a String in PHP Reverse the characters in a string using strrev(). Source Code $originalString = "Hello World!"; $reversedString = strrev($originalString); echo $reversedString; // Outputs: "!dlroW olleH"