Hi all, If i had a list of names for example in a database field what is the function for getting the first letter of those words?
Thanx, mick
<? $name = 'Joe Blow'; $first_letter = substr ($name, 0, 1); ?>
$first_letter equals "J"
There might be a built-in MySQL function for this which would be more efficient.
Try this:
Select left(field,1) from table;
VĂctor Spain