Home > Article > Backend Development > How to use php strrev
php The strrev() function is used to reverse a string and return the reversed string. The syntax is "strrev(string)", and the parameter string specifies the string to be reversed. The strrev() function does not change the original string passed to it as an argument; if a number is passed to the function as an argument, it will reverse the number.
How to use strrev()?
Function: Reverse a string
Syntax:
strrev(string)
Parameters:
string Necessary, specify to reverse The converted string.
Description: Return the reversed string.
php strrev() function example 1
<?php $i = "hello world"; $j = strrev($i); echo $j; ?>
Output:
dlrow olleh
php strrev() function example 2
<?php $i = "I'm study php in php.cn"; $j = strrev($i); echo $j; ?>
Output:
nc.php ni php yduts m'I
The above is the detailed content of How to use php strrev. For more information, please follow other related articles on the PHP Chinese website!