Reverse String in PHP


Prev Tutorial Next Tutorial

Reverse String Program in PHP

strrev() function is used to reverse any given string in php, but here we perform this operation without using strrev() function.

Reverse String Program in PHP

<?php

$string = "hitesh";
$length = strlen($string);

for ($i=($length-1) ; $i >= 0 ; $i--) 
{
  echo $string[$i];
}

?>

Output

	
hsetih

Prev Tutorial Next Tutorial

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain, Tutorialday.com, SeosmoTools.com @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: hitesh.xc@gmail.com WhatsApp no. 8882538826

Yahoo Advertisements