I use the following in mysql to get titles in libray sort, e.g. The Godfather is sorted as Godfather.
SELECT apnumber, aptitle, IF( aptitle LIKE 'The %', SUBSTRING( aptitle, 5 ) , IF( aptitle LIKE 'A %', SUBSTRING( aptitle, 3 ) , IF( aptitle LIKE 'An %', SUBSTRING( aptitle, 4 ) , aptitle ) ) ) AS sorttitle etc...
What's the most efficient way in PHP to change a string into a library sorted version? That is dropping any "An ", "A " or "The " at the beginning of a title. Am I correct in assuming I need to be looking at something like:
substr_replace( "The " , "" , 0)