Cutting "The" off the beginning of a string
Posted: Tue May 23, 2006 12:40 am
I have a database of movie titles. I want to cut "The" off the beginning, so that a movie like "The Lost Boys" would become "Lost Boys". I do it like this:
However, I noticed that trims the beginning of some titles. For instanct, "Team America" becomes "eam America." How can I make sure I only remove "The " and not a word that begins with T?
Code: Select all
$name1 = ltrim($name, "The ");