Re: [PHP] more on trimming

2001-02-17 Thread Christian Reiniger
On Saturday 17 February 2001 09:16, jaskirat wrote: > $var = "This is a variable "; > > Now I want to strip off white spaces on the end without losing them in > the middle of the sentence .. > > > I had figured that there is a no direct way of doing it and some thing > like this > works

Re: [PHP] more on trimming

2001-02-17 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("..s.c.o.t.t..") wrote: > PS: if anyone out there is more familiar with PHP/regexps than i am, > could you please send me an email explaining how to get global > pattern matching (ala perl's s///g command) in PHP?? > i cannot seem to find any sw

Re: [PHP] more on trimming

2001-02-17 Thread Simon Robson
Take a look at: http://www.php.net/manual/en/function.chop.php almost identical to perl's chomp(). At 13:46 17/02/01 +0530, jaskirat wrote: >Since this thread is running I would like to know the gurus' opinons on the >similar following situation > >Suppose there is a variable like this > >$var

RE: [PHP] more on trimming

2001-02-17 Thread ..s.c.o.t.t..
well, there are two solutions, 1) for variables with only whitespace to be trimmed 2) variables with whitespace and \n to be trimmed 1) solution: the way i'd do it too is regexp... very similar to your solution (you're on the right track, but just needed to take that final step) $var = "This i