PHP strrev() Function
In this chapter you will learn:
- Definition for PHP strrev() Function
- Syntax for PHP strrev() Function
- Parameter for PHP strrev() Function
- Return for PHP strrev() Function
- Example - Reverse a string
Definition
The strrev() function reverses a string.
Syntax
PHP strrev() Function has the following syntax.
strrev(string)
Parameter
Parameter | Is Required | Description |
---|---|---|
string | Required. | 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.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP strripos() Function
- Syntax for PHP strripos() Function
- Parameter for PHP strripos() Function
- Return for PHP strripos() Function
- Related functions for PHP strripos() Function
- Example - Find the position of the last occurrence of "php" inside the string
Home » PHP Tutorial » PHP String Functions