Reverse a string is one of the most basic string operations. In PHP, you can use the built-in function strrev() to reverse a string. The following article will take you to understand the strrev() function in PHP.
1. Syntax:
strrev ( string $string ) : string
string: The original string to be reversed.
Return value: Returns the reversed string.
2. Example:
The usual painting style is like this:
<?php $string = 'This is manoj'; $n =strlen("$string"); For($i=1;$i<=$n;$i++) { $val= $string[-$i]; echo $val; } ?>
But With the support of the strrev() function, the painting style is like this:
<?php $string = 'This is manoj'; $n =strlen("$string"); For($i=1;$i<=$n;$i++) { $val= $string[-$i]; echo $val; } echo "<br>"; //真正的画风 echo strrev($string); ?>
Sure enough, as a beginner, I still have to read the manual more than just watching the teaching video.
Recommended: "php video tutorial" "php tutorial"
The above is the detailed content of How to make good use of 'Ace Attorney' in PHP. For more information, please follow other related articles on the PHP Chinese website!