Home  >  Article  >  Backend Development  >  How to use php strrev

How to use php strrev

藏色散人
藏色散人Original
2019-05-23 13:22:363380browse

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 php strrev

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&#39;m study php in php.cn";
$j = strrev($i);
echo $j;
?>

Output:

nc.php ni php yduts m&#39;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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn