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
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
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
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
4 matches
Mail list logo