Skip to content

Instantly share code, notes, and snippets.

@kayalshri
Created February 4, 2014 11:58
Show Gist options
  • Save kayalshri/8802372 to your computer and use it in GitHub Desktop.
Save kayalshri/8802372 to your computer and use it in GitHub Desktop.
To Display reverse Text
<?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