Example 1 — Reverse a Word
The simplest use of strrev().
<?php
$word = "Hello";
echo strrev($word), PHP_EOL; How It Works
- Store a word in a variable.
- Pass it to strrev.
- PHP reads the characters from the end to the start.
- The reversed word is printed.

