Re: reverse string without strrev();
| From: | Aschwin Wesselius | Date: | Thu, 28 Feb 2008 11:30:06 +0000 |
| Subject: | Re: reverse string without strrev(); | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-270530@lists.php.net to get a copy of this message | ||
Shelley wrote:
Hi all, What do you think is the best way to display string 'abcdef' as 'fedcba'?$tmp = ''; $str = 'abcdef'; for ($i = strlen($str); $i >= 0; $i--) { $tmp.= $str[$i]; } echo $tmp; -- Aschwin Wesselius <social> What you would like to be done to you, do that to the other.... </social>