Say I am taking the following information from a textarea:
Coding is cool
Programming is coding
Green screens
I can print it out with bl2br, however what I want it to look like when it’s printed out is this:
<div class="coding">Coding is cool</div><div class="green"><?php //php query doing the same, but for another textbox ?></div><div class="one-more-class"></div>
<div class="coding">Programming is coding</div><?php //php query doing the same, but for another textbox ?></div><div class="one-more-class"></div>
<div class="coding">Green screens</div><?php //php query doing the same, but for another textbox ?></div><div class="one-more-class"></div>
The input has to be from textarea, not from separate textboxes. I’m not going into even more complex jQuery implementation. And speaking of which, no Javascript for this one – I believe it can be done with PHP.
First of all get the array of entries:
then do whatever you want
Need 5.3 for anonymous functions, you may use not anonimous ones instead.
Manuals: