Q:

How to reverse a string in PHP

0

How to reverse a string in PHP

All Answers

need an explanation for this answer? contact us directly to get an explanation for this 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"
?>

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

PHP  and MySQL Frequently Asked Questions

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
How to replace the part of a string with another s... >>
<< How to check whether a variable is null in PHP...