PHP strrev() Function

Definition

The strrev() function reverses a string.

Syntax

PHP strrev() Function has the following syntax.

strrev(string)

Parameter

ParameterIs Required Description
stringRequired. String to reverse

Return

PHP strrev() function returns the reversed string.

Example

Reverse the string "java2s.com!":


<?php
echo strrev("java2s.com!");
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions