English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP strrev() Function Usage and Example

PHP String String Function Manual

The strrev() function is used to reverse the string.

Syntax

string strrev ( string $string )

Definition and Usage

Used to reverse strings

Return Value

It returns the reversed string

Parameter

Serial NumberParameter and Description
1

string

Original String to Be Reversed.

Online Example

Try the following examples, example of reversing characters:

<?php
   //Example of Reversing Characters
   echo strrev("www.w"3codebox.com//moc.ooohn.www
   echo '<br>';
   echo strrev("Hello world!"); // Output "!dlrow olleH"
?>
Test and see‹/›

Output Result

moc.ooohn.www
!dlrow olleH

PHP String String Function Manual