WEB TUTORIALS
PRACTICE EXAMPLES
HTML REFERENCES
CSS REFERENCES
PHP REFERENCES

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.

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

Related FAQ

Here are some more FAQ related to this topic:

Your Feedback:

We would love to hear from you, please drop us a line.