469,927 Members | 1,326 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

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

3
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
Mar 17 '07 #1
2 1656
devsusen
136 100+
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
Mar 17 '07 #2
veinnz
3
hmm yea i think i got it...thanks a lot anyway :D
Mar 17 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

16 posts views Thread by qwweeeit | last post: by
8 posts views Thread by Tjerk Wolterink | last post: by
2 posts views Thread by Wolfgang Jeltsch | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.