Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<strrchrstrripos>
^String FunctionsLast updated: Mon, 26 Oct 2026

strrev

(PHP 4, PHP 5, PHP 7, PHP 8)

strrev — Reverse a string

Description

function strrev(string $string): string

Returns string, reversed.

Parameters

string

The string to be reversed.

Return Values

Returns the reversed string.

Examples

Example #1 Reversing a string with strrev()

<?php
echo strrev("Hello world!"); // outputs "!dlrow olleH"
?>


<strrchrstrripos>
^String FunctionsLast updated: Mon, 26 Oct 2026