1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Reading characters 1 by 1

Discussion in 'PHP' started by Weirfire, Jan 27, 2005.

  1. #1
    I've read characters in with PHP before with the command fgetsc but I am interested in doing it with variables this time. I'm assuming there must be a command but I can't find it anywhere on PHP.net


    EDIT : Ok I think I might be able to do something with the substr() command.
     
    Weirfire, Jan 27, 2005 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    You can also do it like so:
    $yourstring{0} // character 1
    $yourstring{1} // character 2
    $yourstring{2} // character 3
    $yourstring{3} // character 4
    PHP:
     
    digitalpoint, Jan 27, 2005 IP
  3. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #3
    I knew it!!
     
    Weirfire, Jan 27, 2005 IP