WEB TUTORIALS
PRACTICE EXAMPLES
HTML REFERENCES
CSS REFERENCES
PHP REFERENCES
Advertisements

How to reverse a string in PHP

Topic: PHP / MySQLPrev|Next

Answer: Use the PHP strrev() function

You can use the PHP strrev() to reverse the text writing direction of a string.

Let's take a look at an example to understand how it basically works:

<?php
echo strrev("Hello world!"); // Outputs: "!dlrow olleH"
?>

Related FAQ

Here are some more FAQ related to this topic:

Advertisements
Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties