Home » PHP strrev() Function

PHP strrev() Function

by Online Tutorials Library

PHP strrev() Function

The strrev() function is predefined function of PHP. It is used to reverse a string. It is one of the most basic string operations which are used by programmers and developers.

Syntax:

Parameter Description Required/Optional
String Specify the string to reverse Required

Example 1

Output:

Your Number is:Hello PHP  By using 'strrev()' function:PHP olleH  

Example 2

Output:

Your string is:Hello PHP  After using 'strrev()' function:PHP olleH  Again after using 'strrev()'function:Hello PHP  

See Also:

  • trim() : It is used to remove whitespace.
  • ltrim() : It is used to remove whitespace from the left side of a string.
  • rtrim(): It is used to remove whitespace from the right side of a string.
  • md5() : It is used to calculate the MD5 hash of a string.

Reference:

http://php.net/manual/en/function.strrev.php

Next TopicPHP String

You may also like