php

How to reverse a string in PHP

In this tutorial, we are going to see how to reverse a string in PHP. You can use PHP’s strrev() function to reverse the direction of a string.
 

How to reverse a string in PHP
<?php
	echo strrev("Hello world!"); 
?>

Output:

!dlrow olleH
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *