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 762779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:26:57+00:00 2026-05-14T16:26:57+00:00

Please help me to create an array from a field of my DB. That

  • 0

Please help me to create an array from a field of my DB. That field has records separated by comma. Below is the illustration:

ID | article_title_fld         | article_tags_fld                     |
----------------------------------------------------------------------
1  | Learn PHP                 | PHP, coding, scripting               |
3  | Javascript Tutorial       | Javascript, scripting, tutorial      |
4  | Styling with CSS          | CSS, tutorial, web design            |

I want to collect all records in the article_tags_fld then put it into 1 array. Perhaps I named it $array1, and the print out as below:

Array
(
[0] => PHP
[1] => coding
[2] => scripting
[3] => Javascript
[4] => scripting
[5] => tutorial
[6] => CSS
[7] => tutorial
[8] => web design
)
  • 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-05-14T16:26:58+00:00Added an answer on May 14, 2026 at 4:26 pm
    $array1 = array();
    $result = mysql_query("SELECT article_tags_fld FROM MY_TABLE");
    while ($row = mysql_fetch_assoc($result)) {
       $array1 = array_merge($array1, array_map('trim', explode(",", $row['article_tags_fld'])));
    }
    

    explode will split a string by a delimiter.

    array_merge will combine two arrays.

    array_map will apply trim to all elements.

    trim will remove any white space on either side of your tags.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

please tell me that can we create an array of imteger in objective c
Please help me create my own custom layout, container, component, layout manager... Example: Containers
Please help me with using the DrScheme built-in function filter. create a function hello
Please help me finding where I have made mistake? delimiter // CREATE FUNCTION `count_photos_in_gallery`(`tmp_gallery_id`
This is my first android project so please help I am trying to create
can someone please help me out? I'm trying to create an input dynamically with
Please help me understand the following: I create a CharBuffer using CharBuffer.wrapped(new char[12], 2,
After much help from all my StackOverFlow brethren, I managed to create a C++
I am trying to send an Array from one player to another. I create
I have created a table view that pulls its cells from an array. Each

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.