RE: [PHP-DB] "The" Debacle

From: Date: Sun, 24 Feb 2002 23:16:06 +0000
Subject: RE: [PHP-DB] "The" Debacle
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-17244@lists.php.net to get a copy of this message
When you add the data //does it begin with 'The '? $name_start = substr($band_name, 0, 2) if ($name_start=="The") { //remove the word 'The' and following space from the beginning of the string str_replace('The ', '', $band_name) ; //add ', The 'to the end of the name $band_name=$band_name.', The'; } You might want something more sophisticated if The with a capital is found in the middle of names, but hope this is a start Peter ----------------------------------------------- Excellence in internet and open source software ----------------------------------------------- Sunmaia www.sunmaia.net info@sunmaia.net tel. 0121-242-1473 ----------------------------------------------- > -----Original Message----- > From: Jonathan Underfoot [mailto:jonathan@underfoot.cc] > Sent: 24 February 2002 18:36 > To: [PHP-DB] > Subject: [PHP-DB] "The" Debacle > > > I'm putting together a table with bands, and I have a slight > problem. Well it not really a problem as much as I'd like some > input from more seasoned professionals. Certain band names begin > with "The" but when listing them it would be of great advantge to > me to remove the "the." Has anyone else faced this dilemma? I > was thinking that when inputting and editing band names that I > could just scripot a new column with the comma in place. I > suppose librarys have this difficulty as well. So what is it? > > Column 1 - "The Distillers" > Column 2 - "Distillers, The" > > Or a bit of PHP programming every time I list them (seems more difficult.) > > Either way, does anyone have the propper PHP function I should use? > > Thanks much... > > -Jonathan > >

« previous php.db (#17244) next »