By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,777 Members | 1,311 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,777 IT Pros & Developers. It's quick & easy.

How to split string around textarea tags?

P: n/a
I would like to split a string of HTML output into an array on
textarea tags. Example:

<div>Hello this is my content <textarea>foo</textareaand this is
also
content <b>some bold text</b<textarea>bar and so forth...</textarea>
here my final content.</div>

The output should be:

Array(
0 =<div>Hello this is my content
1 =<textarea>foo</textarea>
2 =and this is also content <b>some bold text</b>
3 =<textarea>bar and so forth...</textarea>
4 =here my final content.</div>
);

I am fairly new to PHP, so I've been browsing php.net and found some
usefull functions, including strstr, explode and str_split but don't
know how to combine these into a working function. Could anybody
please help me on my way? Your help is appreciated!
Jan 4 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
nu*******@yahoo.com wrote:
I would like to split a string of HTML output into an array on
textarea tags.
*If* you're dealing with well-formed XHTML, try out simplexml.

Besides that, grab a hold onto a book on compilers and parsers.
Cheers,
--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Un ordenador no es un televisor ni un microondas, es una herramienta
compleja.
Jan 4 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.