Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    kjc
    kjc is offline
    New Coder
    Join Date
    Jun 2002
    Location
    England
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting the first character from a word

    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
    Eternity

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    $myname "Joe";
    echo 
    $myname{0}; 
    would return "J"

  • #3
    kjc
    kjc is offline
    New Coder
    Join Date
    Jun 2002
    Location
    England
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by x_goose_x
    PHP Code:
    $myname "Joe";
    echo 
    $myname{0}; 
    would return "J"
    Thanks goose
    I have finally got around to using this code.

    Cheers
    Eternity


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •