Results 1 to 3 of 3

Thread: [RESOLVED] How to trim string to first 3 characters

  1. #1

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Resolved [RESOLVED] How to trim string to first 3 characters

    I have a string which comprises of many caracters, the only data that is useful to me is the first 3 numbers.

    How do i trim the string to become only the first 3 characters?

    ILMV

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: How to trim string to first 3 characters

    You could use the substr function

    IE) $test = substr($string,startchar,length)

    http://ca3.php.net/manual/en/function.substr.php


    HTH

  3. #3

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: How to trim string to first 3 characters

    Thank You

Posting Permissions

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



Click Here to Expand Forum to Full Width