how to compare the distribution of whitespace between two text area?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • veinnz
    New Member
    • Mar 2007
    • 3

    how to compare the distribution of whitespace between two text area?

    hi all...
    i'm kinda newbie in php...so i would like to ask ur guidance on how to compare the distribution of whitespace between two text area?
    so let's say
    text area 1 i type : hi how are you
    text area 2 i type : you've got it right

    both has the same distribution of white space
    but since php ignore the whitespace..
    i've this idea is by replacing all the whitespace into something else 1st...let's say to "@".. bt then i've problem on how to store the "@" into the array too

    so what i want is that the array is store become like this..
    array[0] = hi
    array[1] = @
    array[2] = how
    array[3] = @
    array[4] = are
    array[5] = @
    array[6] = you

    so that i can compare with the text area 2 input to c whether the location of the whitespace between them is the same...

    anyone pls give me guidance on this...sorry if i confuse all of u..
    anyway thx in advance
  • devsusen
    New Member
    • Feb 2007
    • 136

    #2
    Hi,

    I think u should better use split() for this purpose.

    store the content of textarea1 value in a variable and use split() with whitespace as the delimiter and store it in a array. Do same for the textarea2. Now compare those two array.

    susen

    Comment

    • veinnz
      New Member
      • Mar 2007
      • 3

      #3
      hmm yea i think i got it...thanks a lot anyway :D

      Comment

      Working...