ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

An or A?

October 04, 2010 5:01pm

Subscribe [2]
  • #1 / Oct 04, 2010 5:01pm

    adamlunn

    2 posts

    A quick question.

    I have a website that has various entries, and they are titled as various business titles,

    i.e.

    Bakery
    Restuarant
    Archery Business

    etc etc.

    I was wondering, is there any way to find the first letter of the title, and then use that in an if statement so that the correct language could be used in the following:

    “How to start a/an Bakery?” - where a/an is replaced with the correct word, taking into consideration if the next word begins with a vowel or not.

    Hope I’m making sense…

    Thanks

    Adam

  • #2 / Oct 04, 2010 5:08pm

    Ingmar

    29245 posts

    It’s hard to do this programmatically. What counts is pronunciation, not simply vowels vs. consonants: a uniform, an ulcer, an honor, a horse, a European ... Sure, if you want quick & dirty just grab the first letter with PHP and take it from there.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases