RE: [PHP] Chomp, Chomp, Chomp

2003-06-23 Thread Dan Joseph
Hi,

chop and rtrim just take out white space.  Perl's chomp takes off the last
character no matter what it is.

$foo = substr($foo, 0, -1);

That will emulate Perl's chomp.

-Dan Joseph

> -Original Message-
> From: Sparky Kopetzky [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 20, 2003 6:38 PM
> To: PHP General
> Subject: [PHP] Chomp, Chomp, Chomp
>
>
> Does anyone have a piece of code that emulates a Perl 'Chomp'
> function? I need one.
>
> Thanks in advance!!
>
> Robin E. Kopetzky
> Black Mesa Computers/Internet Services
> www.blackmesa-isp.net
>
>


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



RE: [PHP] Chomp, Chomp, Chomp

2003-06-20 Thread Lars Torben Wilson
On Fri, 2003-06-20 at 16:16, Aaron Axelsen wrote:
>  -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> The php chop function is suppose to act like the perl chomp.

No, chop() is an alias for rtrim(), and is identical in every way
(save for its name, of course...)

   http://www.php.net/chop


Cheers,

Torben

-- 
 Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 http://www.hybrid17.com  http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com -




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



RE: [PHP] Chomp, Chomp, Chomp

2003-06-20 Thread Aaron Axelsen
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

The php chop function is suppose to act like the perl chomp.

- ---
Aaron Axelsen
AIM: AAAK2
Email: [EMAIL PROTECTED]

Want reliable web hosting at affordable prices?
www.modevia.com
 
Web Dev/Design Community/Zine
www.developercube.com



- -Original Message-
From: Lars Torben Wilson [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 20, 2003 6:00 PM
To: Sparky Kopetzky
Cc: PHP General
Subject: Re: [PHP] Chomp, Chomp, Chomp


On Fri, 2003-06-20 at 15:47, Sparky Kopetzky wrote:
> I looked at the documentation on rtrim. It trims ALL whitespace 
> characters from the end, not just the '\n'. I need only the '\n' 
> trimmed.

Look again, but check out the second argument:




Good luck,

Torben


> Sparky
> - Original Message -
> From: "Lars Torben Wilson" <[EMAIL PROTECTED]>
> To: "Sparky Kopetzky" <[EMAIL PROTECTED]>
> Cc: "PHP General" <[EMAIL PROTECTED]>
> Sent: Friday, June 20, 2003 16:47
> Subject: Re: [PHP] Chomp, Chomp, Chomp
> 
> 
> > On Fri, 2003-06-20 at 15:37, Sparky Kopetzky wrote:
> > > Does anyone have a piece of code that emulates a Perl 'Chomp' 
> > > function?
> I need one.
> > >
> > > Thanks in advance!!
> > >
> > > Robin E. Kopetzky
> > > Black Mesa Computers/Internet Services www.blackmesa-isp.net
> >
> > This should do it for you:  http://www.php.net/rtrim
> >
> >
> > Good luck!
> >
> >
> > Torben
> >
> >
> > --
> >  Torben Wilson <[EMAIL PROTECTED]>   
> > +1.604.709.0506 
> >  http://www.thebuttlesschaps.com 
> > http://www.inflatableeye.com 
> >  http://www.hybrid17.com 
> > http://www.themainonmain.com 
> >  - Boycott Starbucks!  http://www.haidabuckscafe.com 
> > -
> >
> >
> >
- -- 
 Torben Wilson <[EMAIL PROTECTED]>   
+1.604.709.0506
 http://www.thebuttlesschaps.com 
http://www.inflatableeye.com
 http://www.hybrid17.com 
http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com
-




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

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPvOV0brnDjSLw9ADEQLbXACeKGsGbjjW3pGWT91Jd3cQP48wq+oAn1Ev
gb2AnVvs5zgRdejT13vmNoJ2
=gg1T
-END PGP SIGNATURE-



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



Re: [PHP] Chomp, Chomp, Chomp

2003-06-20 Thread Lars Torben Wilson
On Fri, 2003-06-20 at 15:47, Sparky Kopetzky wrote:
> I looked at the documentation on rtrim. It trims ALL whitespace characters
> from the end, not just the '\n'. I need only the '\n' trimmed.

Look again, but check out the second argument:




Good luck,

Torben


> Sparky
> - Original Message -
> From: "Lars Torben Wilson" <[EMAIL PROTECTED]>
> To: "Sparky Kopetzky" <[EMAIL PROTECTED]>
> Cc: "PHP General" <[EMAIL PROTECTED]>
> Sent: Friday, June 20, 2003 16:47
> Subject: Re: [PHP] Chomp, Chomp, Chomp
> 
> 
> > On Fri, 2003-06-20 at 15:37, Sparky Kopetzky wrote:
> > > Does anyone have a piece of code that emulates a Perl 'Chomp' function?
> I need one.
> > >
> > > Thanks in advance!!
> > >
> > > Robin E. Kopetzky
> > > Black Mesa Computers/Internet Services
> > > www.blackmesa-isp.net
> >
> > This should do it for you:  http://www.php.net/rtrim
> >
> >
> > Good luck!
> >
> >
> > Torben
> >
> >
> > --
> >  Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506
> >  http://www.thebuttlesschaps.com  http://www.inflatableeye.com
> >  http://www.hybrid17.com  http://www.themainonmain.com
> >  - Boycott Starbucks!  http://www.haidabuckscafe.com -
> >
> >
> >
-- 
 Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 http://www.hybrid17.com  http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com -




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



Re: [PHP] Chomp, Chomp, Chomp

2003-06-20 Thread Lars Torben Wilson
On Fri, 2003-06-20 at 15:37, Sparky Kopetzky wrote:
> Does anyone have a piece of code that emulates a Perl 'Chomp' function? I need one.
> 
> Thanks in advance!!
> 
> Robin E. Kopetzky
> Black Mesa Computers/Internet Services
> www.blackmesa-isp.net

This should do it for you:  http://www.php.net/rtrim


Good luck!


Torben


-- 
 Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 http://www.hybrid17.com  http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com -




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



Re: [PHP] Chomp, Chomp, Chomp

2003-06-20 Thread Sparky Kopetzky
I looked at the documentation on rtrim. It trims ALL whitespace characters
from the end, not just the '\n'. I need only the '\n' trimmed.

Sparky
- Original Message -
From: "Lars Torben Wilson" <[EMAIL PROTECTED]>
To: "Sparky Kopetzky" <[EMAIL PROTECTED]>
Cc: "PHP General" <[EMAIL PROTECTED]>
Sent: Friday, June 20, 2003 16:47
Subject: Re: [PHP] Chomp, Chomp, Chomp


> On Fri, 2003-06-20 at 15:37, Sparky Kopetzky wrote:
> > Does anyone have a piece of code that emulates a Perl 'Chomp' function?
I need one.
> >
> > Thanks in advance!!
> >
> > Robin E. Kopetzky
> > Black Mesa Computers/Internet Services
> > www.blackmesa-isp.net
>
> This should do it for you:  http://www.php.net/rtrim
>
>
> Good luck!
>
>
> Torben
>
>
> --
>  Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506
>  http://www.thebuttlesschaps.com  http://www.inflatableeye.com
>  http://www.hybrid17.com  http://www.themainonmain.com
>  - Boycott Starbucks!  http://www.haidabuckscafe.com -
>
>
>


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



[PHP] Chomp, Chomp, Chomp

2003-06-20 Thread Sparky Kopetzky
Does anyone have a piece of code that emulates a Perl 'Chomp' function? I need one.

Thanks in advance!!

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net