PHP strpos

Discussion in 'PHP' started by Weirfire, May 18, 2006.

  1. #1
    Is it possible to do a right to left search with strpos so for example I had the following variable

    $text = "abcdefghijklmnopqrstuvwxyz";

    I could do a right to left search from z till I find p and the position it gives me is $x characters from z which would be 10.
     
    Weirfire, May 18, 2006 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    T0PS3O, May 18, 2006 IP
    Weirfire likes this.
  3. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #3
    Genius!! More green blobs for T0PS
     
    Weirfire, May 18, 2006 IP
  4. SERPalert

    SERPalert Guest

    Messages:
    1,003
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It's horrible to use for the first time, but once you got it you'll be cooking.

    There's some good examples in the comments on php.net IIRC.

    Good luck.
     
    SERPalert, May 18, 2006 IP
  5. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #5
    lol I wouldn't really say it's horrible. It's problems like this that make me enjoy programming so much. :)
     
    Weirfire, May 18, 2006 IP
  6. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You enjoy getting other people to solve them for you, you mean :)
     
    T0PS3O, May 18, 2006 IP
  7. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #7
    I only ask people to give me the tools to solve the bigger picture. This particular job has taken about 16 hours work! lol
     
    Weirfire, May 18, 2006 IP