Jump to content

rajivgonsalves

Members
  • Posts

    2,166
  • Joined

  • Last visited

    Never

Everything posted by rajivgonsalves

  1. if your looking for one that checks the starting letter I think the following should do <?php function getBefore($word) { return in_array(strtolower(substr($word,0,1)), array('a','e','i','o','u')) ? 'an' : 'a'; } echo getBefore('english') . '<br />'; echo getBefore('spanish') . '<br />'; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.