PHP reverse string function strrev()

黄舟
Release: 2023-03-17 06:50:01
Original
1817 people have browsed it

Example

ReverseString "Hello World!":

<?php
echo strrev("Hello World!");
?>
Copy after login

Definition and usage

strrev() FunctionReverse the string.

Syntax

strrev(string)
Copy after login
ParametersDescription
string Required. Specifies the string to reverse.

Technical Details

Return value: Returns the reversed string.
PHP version: 4+
##Example

<?php 
echo strrev("Hello World!"); 
?>
Copy after login

Output:


!dlroW olleH
Copy after login

For example:

<?php 
$str="Hello world"; 
$result=strrev($str); 
echo $result; 
//输出的结果是:dlrow olleH; 
?>
Copy after login


The above is the detailed content of PHP reverse string function strrev(). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!