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...

<?php
if (substr($table['field'], 0, 1)=="a") OR (substr($table['field'], 0, 
1)=="e") OR (substr($table['field'], 0, 1)=="i") OR 
(substr($table['field'], 0, 1)=="u") OR (substr($table['field'], 0, 
1)=="y") }
echo 'Member has an ' . $table['field'] . ' who is...';
} else {
echo 'Member has a ' . $table['field'] . 'who is...';
}
?>

There's got to a cleaner way to do this. Perhaps using a list or array 
containing the vowels and steping through it checking the first letter of 
the field contents against each member of the list. But, I don't know how 
to code this system. Please help.

Thanx,
Robb

-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams
----------------------------------------------------
http://www.digitaliguana.com
http://www.cancerreallysucks.org

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

Reply via email to