Oct 23, 2001 #1 Naits Programmer Oct 10, 2001 90 NO My variable is $name="Stian"; how can i getthe first letter in that variable?
Oct 23, 2001 #2 GIGN Programmer Oct 6, 2000 1,082 NZ int ord (string string) Returns the ASCII value of the first character of string. This function complements chr(). download the PHP manual - has all this stuff. http://www.php.net/download-docs.php [bb] Upvote 0 Downvote
int ord (string string) Returns the ASCII value of the first character of string. This function complements chr(). download the PHP manual - has all this stuff. http://www.php.net/download-docs.php [bb]
Oct 24, 2001 #3 Glowball Programmer Oct 6, 2001 373 US That returns an integer (the ASCII value), you might try Code: substr ($name, 0, 1); Upvote 0 Downvote