Skip to content

Instantly share code, notes, and snippets.

@shyuan
Last active March 15, 2018 17:53
Show Gist options
  • Save shyuan/163458f0ce54991ba0fa9ec9526bfafb to your computer and use it in GitHub Desktop.
Save shyuan/163458f0ce54991ba0fa9ec9526bfafb to your computer and use it in GitHub Desktop.
Reverse String from STDIN
<?php
while ($string = trim(fgets(STDIN))) {
echo strrev($string) . PHP_EOL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment