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
[EMAIL PROTECTED]
tel. 0121-242-1473
-----------------------------------------------

> -----Original Message-----
> From: Jonathan Underfoot [mailto:[EMAIL PROTECTED]]
> 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
>
>


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

Reply via email to