On Thu, Feb 28, 2008 at 3:25 AM, Shelley <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> What do you think is the best way to display string 'abcdef' as 'fedcba'?
>
> Any ideas appreciated.
>
> Thanks in advance.
>
>
> --
> Regards,
> Shelley
>
...What is wrong with strrev()? Am I missing something
On Thu, 2008-02-28 at 16:26 +, Robin Vickery wrote:
> On 28/02/2008, Robert Cummings <[EMAIL PROTECTED]> wrote:
> >
> > There's always a tradeoff between speed and memory. Here's the low
> > memory version:
> >
> > >
> > $str = '1234567';
> > str_reverse_in_place( $str );
> > echo 'Rever
On 28/02/2008, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> On Thu, 2008-02-28 at 12:39 +, Nathan Rixham wrote:
> > Aschwin Wesselius wrote:
> > > Stut wrote:
> > >> Just because it works doesn't mean it's right.
> > >>
> > >> -Stut
> > >>
> > >
> > >
> > > What I meant was that I t
Robert Cummings wrote:
It wouldn't really be "in place" if it wasn't a reference. Since the
engine would immediately perform a copy on the first write to a passed
non reference string :)
Still to much to learn. Nice list to learn from thanks.
I just started to learn more and more ab
Sorry, Rob, that function doesn't return anything. ;-)
It's not meant to:
--
Richard Heyes
Employ me (!):
http://www.phpguru.org/cv
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Thu, 2008-02-28 at 16:39 +0100, Aschwin Wesselius wrote:
> Aschwin Wesselius wrote:
> > Sorry, Rob, that function doesn't return anything. ;-)
>
>
> Bugger, it's getting late. Didn't see the &.
It wouldn't really be "in place" if it wasn't a reference. Since the
engine would immediat
Aschwin Wesselius wrote:
Sorry, Rob, that function doesn't return anything. ;-)
Bugger, it's getting late. Didn't see the &.
--
Aschwin Wesselius
What you would like to be done to you, do that to the other
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, v
Robert Cummings wrote:
There's always a tradeoff between speed and memory. Here's the low
memory version:
Sorry, Rob, that function doesn't return anything. ;-)
--
Aschwin Wesselius
What you would like to be done to you, do that to the other
--
PHP General Mailing List (ht
On Thu, 2008-02-28 at 12:39 +, Nathan Rixham wrote:
> Aschwin Wesselius wrote:
> > Stut wrote:
> >> Just because it works doesn't mean it's right.
> >>
> >> -Stut
> >>
> >
> >
> > What I meant was that I tested the script and it worked, so I didn't
> > spot the flaw (wich is obvious and you
> >> 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!)
> cheers for the heads up on curlies Mike :)
Where can I read more information about this?
thnx,
Chris
--
PHP General Mailing List
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--) {
$
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
Nathan Rixham wrote:
should it not use curlies?
I don't know. What is the leading preference nowadays? Does it matter?
Somewhere in the past I learned it with the square brackets like an
array and it still works like that. Maybe it isn't 'right' (Stut?), but
that is the way I picked it up.
Aschwin Wesselius wrote:
Stut wrote:
Just because it works doesn't mean it's right.
-Stut
What I meant was that I tested the script and it worked, so I didn't
spot the flaw (wich is obvious and you were right).
No big deal.
should it not use curlies?
$tmp = '';
$str = 'abcdef';
for (
Stut wrote:
Just because it works doesn't mean it's right.
-Stut
What I meant was that I tested the script and it worked, so I didn't
spot the flaw (wich is obvious and you were right).
No big deal.
--
Aschwin Wesselius
What you would like to be done to you, do that to the other
On 28 Feb 2008, at 11:40, Aschwin Wesselius wrote:
Stut wrote:
On 28 Feb 2008, at 11:30, Aschwin Wesselius wrote:
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.=
Stut wrote:
On 28 Feb 2008, at 11:30, Aschwin Wesselius wrote:
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;
Close, but no cigar. $i s
On 28 Feb 2008, at 11:30, Aschwin Wesselius wrote:
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;
Close, but no cigar. $i should be ini
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
What you would like to be done to you, do that to the other
Hi all,
What do you think is the best way to display string 'abcdef' as 'fedcba'?
Any ideas appreciated.
Thanks in advance.
--
Regards,
Shelley
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
20 matches
Mail list logo