Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8336577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:02:08+00:00 2026-06-09T04:02:08+00:00

Say I am taking the following information from a textarea : Coding is cool

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:02:10+00:00Added an answer on June 9, 2026 at 4:02 am

    First of all get the array of entries:

    $ar = explode("\n", $_POST['textarea']);
    

    then do whatever you want

    echo implode("\n", arrray_map(function($str){
        //query
        return '<div class="coding">'.$str.'</div><div class="green">'.$queryres.'</div><div class="one-more-class"></div>';
    }, $ar));
    

    Need 5.3 for anonymous functions, you may use not anonimous ones instead.

    Manuals:

    • array_map
    • explode
    • implode
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't figure out how to say what I'm talking about which is a
Say I am using the following interface (assume we can't change our implementation to
After taking quite a long break from active coding I am just starting to
Taking a dictionary as an example, let's say I've got the following array to
Say i have a few fields like the following: abd738927 jaksm234234 hfk342 ndma0834 jon99322
I'm using PHP to get XML from an API (Say that 3 times fast).
I am developing a search engine. I am thinking about taking unique words from
Say I have the following hashes: hash_x = { :a => 1, :b =>
I was wondering if someone can help me solve the following problem. Someone has
Let's say we have the following js array var ar = [ [2,6,89,45], [3,566,23,79],

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.