strrev() – Reversing a String in PHP
This article explains the PHP strrev() function, detailing its syntax, parameter description, return value, and provides a clear example that demonstrates how to reverse a string such as "Hello world!" using this built‑in function.
The strrev() function in PHP returns the reversed version of a given string.
Signature: string strrev(string $string) Parameter: $string – the original string to be reversed.
Return value: The function returns a new string that is the reverse of the input.
Example:
<?php
echo strrev("Hello world!");
// 输出 "!dlrow olleH"
?>The above code outputs !dlrow olleH, demonstrating the function’s effect.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
