...

View Full Version : Getting the first character from a word



kjc
02-28-2003, 07:47 PM
I have an ecommerce site and I wish to update the database by further categorising the products.
I want to categorise the products by authors with a different category for each letter.

Can anyone tell me how I can get the first character from a word? - If i know this then I will be able to write the rest of the script....

Thanks

Kjc:thumbsup:

x_goose_x
02-28-2003, 08:53 PM
$myname = "Joe";
echo $myname{0};


would return "J"

kjc
03-17-2003, 09:43 PM
Originally posted by x_goose_x


$myname = "Joe";
echo $myname{0};


would return "J"

Thanks goose
I have finally got around to using this code.

Cheers :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum