Skip to content

Instantly share code, notes, and snippets.

@rajvanshipradeep15
Created November 11, 2016 19:16
Show Gist options
  • Save rajvanshipradeep15/edbed3ba481d6d610e163e53d1d6ee16 to your computer and use it in GitHub Desktop.
Save rajvanshipradeep15/edbed3ba481d6d610e163e53d1d6ee16 to your computer and use it in GitHub Desktop.
string reversing
<?php
$string = 'Weekend php';
$length = strlen($string);
echo "Length: " . $length;
echo "<br>";
$iteration =1;
for ($i=($length-1) ; $i >= 0 ; $i--) {
echo $string[$i];
$iteration++;
}
echo "total iteration: " . $iteration;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment