string strrev ($inpString)Parameter:This function takes one parameter $inpString. This parameter is a string and defines the string that we want to change. If passed a number instead of a string, it will reverse that number as well.Returned value:The strrev() function returns the reverse of a string or number. It does not make any changes to the original string or the number passed in the parameter.Examples:
Input: $string = "engineer" Output: skeeg Input: $string = 143 Output: 341The following programs illustrate the strrev() function in PHP:Program 1:PHP program to demonstrate the strrev() function when passing a string.
// PHP demo program
// strrev() function when passing a string
// prints back line
skeegProgram 2:PHP program to demonstrate the strrev() function when passing a number.
// PHP program for demonstration
// strrev() function when passing a number
// passing a number instead of a string
// prints the reverse number
A Practical Approach to Computer Algorithms Using Python® and C# Rod Stephens started out as a mathematician, but while studying at MIT, he discovered how much fun algorithms are. He took every al...
Learn how data literacy is changing the world and giving you a better understanding of life's biggest problems in this "Important and Comprehensive" Guide to Statistical Thinking (New York). The bi...
Why this Book? Hadoop has been the base for most of the emerging technologies in today’s big data world. It changed the face of distributed processing by using commodity hardware for large data set...
Automate the Boring Stuff with Python PDF, 2nd Edition: Practical Programming for Total Beginners Illustrated Edition. The second edition of this Python bestseller (over 100,000 copies sold in prin...