Created
February 4, 2014 11:58
-
-
Save kayalshri/8802372 to your computer and use it in GitHub Desktop.
To Display reverse Text
This file contains 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 | |
$reverse = array(); | |
# Split based on space (words) | |
$words = explode(' ', 'samsung galaxy 8260'); | |
# Get the words count | |
$toProcess = count($words); | |
while ($toProcess--) { | |
$reverse[] = $words[$toProcess]; | |
} | |
# Merge | |
echo implode(' ', $reverse); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment