Created
November 11, 2016 19:16
-
-
Save rajvanshipradeep15/edbed3ba481d6d610e163e53d1d6ee16 to your computer and use it in GitHub Desktop.
string reversing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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