55 users online (1 members and 54 guests)  

Thread: chop help


  Results 1 to 2 of 2
  1. #1
    samip1983's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2005
    Posts
    2

    chop help

    Hi does anyone know if it possible to restrict the number of charectors before you chop it?

    For example if the input is a postcode like:- CV11 8JJJ and you wanted to restrict the postcode to being CV11 8JJ?? or a relevant UK postcode?

    Thanks

  2. #2
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: chop help

    do you mean like:

    if i have the number "1234567890" but i want to limit it to 5 characters, so it will make "12345" and delete the rest of it?

    simple:
    Code:
    $a = substr("thisIsAnExample", 0, 6);



Tags for this Thread