Re: reverse string without strrev();

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ford, Mike wrote:
On 28 February 2008 12:39, Nathan Rixham advised:


should it not use curlies?

No, they will be deprecated as of PHP6. (Square brackets used to be, but
have been undeprecated and are back in favour!)

$tmp = '';
$str = 'abcdef';
for ($i = strlen($str)-1; $i >= 0; $i--) {
  $tmp.= $str{$i};
}
echo $tmp;

Cheers!

 --
Mike Ford,  Electronic Information Services Adviser,
JG125, The Headingley Library,
James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: m.ford@xxxxxxxxxxxxxx
Tel: +44 113 812 4730          Fax:  +44 113 812 3211


To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

cheers for the heads up on curlies Mike :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux