count character and reduct credits

Discussion in 'PHP' started by TheSyndicate, Aug 18, 2008.

  1. #1
    I am looking for some code that will count character and tell me how many they are. If they are 50 I want 1 credit if they are 100 I want 2 credit reeducated.

    I already have the system behind it but I do not have this counting and deduct credit depend on how many character.

    Anybody have this code on their desktop? Or can point me the right way
     
    TheSyndicate, Aug 18, 2008 IP
  2. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #2
    Something like this?
    $credits = floor(strlen($str)/50)
    PHP:
    If not, can you clarify what you want.
     
    krt, Aug 18, 2008 IP
  3. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #3
    Something that count character in a box. If i put 50 character including space it will take 1 credit, 100 2 credit
     
    TheSyndicate, Aug 18, 2008 IP