Online Snippets Library

strrev function in PHP

strrev() is used to reverse string.

Syntax

string strrev ( string $string )

Example

<?php
echo strrev("Hello world!");
?>

Out Put

Reverse string: !dlrow olleH