How to reverse a string in PHP

  1891 views   2 years ago PHP

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"
?>

i hope you like this one.

Author : Harsukh Makwana
Harsukh Makwana

Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]