473,385 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1888
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

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

Similar topics

16
by: qwweeeit | last post by:
In analysing a very big application (pysol) made of almost 100 sources, I had the need to remove comments. Removing the comments which take all the line is straightforward... Instead for the...
3
by: jyoti | last post by:
Hi there, I am trying to compare two strings and get the differenc in vbscript. Example: Str1="This is a test text" Str2="This is a fine test text but a little long" I like to compare str1...
8
by: Tjerk Wolterink | last post by:
Hello all, how does xsl handle white space? I know you can set domething like this for nice indentation: <xsl:output method="xhtml" indent="yes"/> But know i have xsl code like this:
2
by: Wolfgang Jeltsch | last post by:
Hello, it is often convenient to insert whitespace into an XML document in order to format it nicely. For example, take this snippet of a notional DocBook XML document: <para> This is a...
11
by: Brian W | last post by:
Yet another editor problem To reproduce do the following 1) Open a Webform and switch to HTML edit mode 2) Enter the Following (include spaces) This is some text before <asp:hyperlink...
0
by: Brian Kitt | last post by:
I have a very long table, about 200 rows. I am trying to make buttons that can alternately hide and reveal sections of the table. It's easy enough to hide and reveal sections with the...
1
by: Neilen Marais | last post by:
Hi I'm trying to compare some text to find differences other than whitespace. I seem to be misunderstanding something, since I can't even get a basic example to work: In : d =...
1
by: nicky77 | last post by:
Hi, I've created a nav bar using a background image for rollover effects. Everything works as I had hoped, however, for some reason it seems that an area of whitespace (the same size of the...
8
by: DotNetNewbie | last post by:
Hi, I have text in a file that looks like this: What kind of regex could get the '2' ?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.