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"
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments