What is the code for php string flipping

青灯夜游
Release: 2023-03-11 10:32:01
Original
2152 people have browsed it

The code for php string flipping is "strrev(string)", and the parameter string is used to specify the string to be flipped; if it is passed to a number instead of a string, it will also flip the number. The strrev() function does not make any changes to the original string passed to it as an argument.

What is the code for php string flipping

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

php string flip (Reverse)

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

Output:

!dlroW olleH
Copy after login

Description:

strrev() function Strings can be flipped (reversed). Grammar format:

strrev(string)
Copy after login

Parameter string: Specifies the string to be reversed and cannot be omitted. If you pass it a number instead of a string, it will also reverse the number.

Return value: Return the reversed string or number. It does not make any changes to the original string or number passed in the argument.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What is the code for php string flipping. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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