> > > I need some help with a looping syntax. In english, "a" is used before
> > > words that begin with consonants - "an" is used before words that start
> > > with vowels. I'm trying to create a loop that checks this state and inserts
> > > the correct word in the echo line. Below is the sloppy version of what I'm
> > > trying to do...

One more variant:

function a_an ($word)
    {
    return (stristr ("aeiouAEIOU", $word{0}) ? "an " : "a ") . $word;
    }

echo "Member has " . a_an ($table['field']) . " who is...";


Any time you start typing minor variants of the same thing over and
over, an alarm should go off in your head. That's what computers are
here to save us from!

pb


-- 
paul bissex, e-scribe.com -- database-driven web development
413.585.8095
69.55.225.29
01061-0847
72°39'71"W 42°19'42"N

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

Reply via email to