Re: rtrim

From: ryanne cruz <ryanne(dot)cruz(at)up(dot)edu(dot)ph>
To: "jlarson(at)candlefire(dot)org" <jlarson(at)candlefire(dot)org>, pgsql-php(at)postgresql(dot)org
Subject: Re: rtrim
Date: 2003-01-22 06:41:28
Message-ID: 1043217688.3e2e3d1880fb9@mail.up.edu.ph
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Thanks Jason.

but my data in that column varies. what i mean is that not all data ends in ",
USA". some ends in ", Italy" or ", England". if i understood your code right,
this only works when all my data ends with ", USA" or any country with 3
letters on it. anymore ideas?



Quoting Jason k Larson <jlarson(at)candlefire(dot)org>:

> rtrim and ltrim are used to remove whitespaces. I'm not certain why you
> are getting unpredictable behavior, but try this instead.
>
> $column = substr ($column, 0, strlen($column)-5); // 5 = ', USA'
>
> http://www.php.net/manual/en/function.substr.php
>
> HTH,
> Jason k Larson
>
>
> ryanne cruz wrote:
>
> >
> > hi list.
> >
> > if there's anyone here who's familiar with teh rtrim function, please
> > i need
> > help.
> >
> > i have a table that has a column in it that has data in this format:
> >
> > California, USA
> > Nevada, USA
> > .
> > .
> > .
> >
> > when i use rtrim to erase the ", USA" part, it only sometimes work. a
> > sample
> > result would be:
> >
> > California
> > Nevad
> >
> > my query statement is:
> > update table set name=rtrim(name,', USA');
> >
> > why is it that it only works sometimes?
>
>

In response to

  • rtrim at 2003-01-22 06:25:28 from ryanne cruz

Browse pgsql-php by date

  From Date Subject
Next Message ryanne cruz 2003-01-22 07:14:17 empty
Previous Message ryanne cruz 2003-01-22 06:25:28 rtrim