Home  >  Article  >  Backend Development  >  What is the code for php string flipping

What is the code for php string flipping

青灯夜游
青灯夜游Original
2021-07-07 18:31:592015browse

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!");
?>

Output:

!dlroW olleH

Description:

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

strrev(string)

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!

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