Finding the number of occurence of a word

Discussion in 'PHP' started by abhilashdas, Jan 10, 2008.

  1. #1
    Hi I need to find the number of occurence of each word in a string. Can anybody tell me how to do that?
    For ex, "php is the only substitute for php" should return
    php-2
    is-1
    the-1
    substitute-1
    etc
    Any idea?
     
    abhilashdas, Jan 10, 2008 IP
  2. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #2
    commandos, Jan 10, 2008 IP
  3. olddocks

    olddocks Notable Member

    Messages:
    3,275
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    215
    #3
    just use this function.

    see php manual
     
    olddocks, Jan 10, 2008 IP