PHP strrev() Function
Topic: PHP String ReferencePrev|Next
Description
The strrev()
function reverses a string.
The following table summarizes the technical details of this function.
Return Value: | Returns the reversed string. |
---|---|
Version: | PHP 4+ |
Syntax
The basic syntax of the strrev()
function is given with:
strrev(string);
The following example shows the strrev()
function in action.
Example
Run this code »<?php
// Sample string
$str = "Hello World!";
// Reversing the string
echo strrev($str);
?>
Parameters
The strrev()
function accepts the following parameters.
Parameter | Description |
---|---|
string | Required. Specifies the string to reverse. |