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

  • Home
  • SEARCH
  • 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 8242595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:13:22+00:00 2026-06-07T21:13:22+00:00

how to parse a column in mysql table like <14-abc>;<8-def>; as: abc =14 def

  • 0

how to parse a column in mysql table like <14-abc>;<8-def>;
as:

abc =14
def = 8

abc store value 14 and def stores values 8 and have multiple entries.

So need to store like array or list that should be able to access and
process the parsed data later.

  • 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-07T21:13:24+00:00Added an answer on June 7, 2026 at 9:13 pm

    I’m not aware of any parser that support this syntax, so you could write your own parser for something so trivial. Here’s an example, not tested:

    $row = ' <14-abc>;<8-def>; ';
    
    $output = Array();
    $entries = explode(';', $row);              //Split the row by every ';' delimiter
    foreach ($entries as $item) {               //For each entries
        if (!empty($item)) {                    //Make sure the item isn't empty (last entry might be)
            $item = str_replace(' ','',$item);  //Remove useless char
            $item = str_replace('<','',$item);  //Remove useless char
            $item = str_replace('>','',$item);  //Remove useless char
            $params = explode('-', $item);      //Again, subsplit the key and the value from the item
            $output[$params[1]] = $params[0];   //Push them into an array
        }
    }
    

    Then you can use your awesome array like so:

    foreach ($output as $key=>$value) {
        echo $key.'='.$value;
    }
    

    The input is a $row string, the output is a $output array. You can even wrap it into a function 😉

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

Sidebar

Related Questions

I have user table having fields gender and first name like this.. The value
I have xml column in a table and I want to parse the xml
I need to get the last inserted id of table that have multi-column primary
I have a MySQL MyISAM table containing entries that describe airports. This table contains
Can I parse the html tables by giving only column name ? Like only
I have a problem. I have a SQL Server table that stores a bunch
I have a MySQL database , with a column that is date type DATETIME
In MSSQL you can convert a string into an integer like this: CONVERT(INT, table.column)
I have a dataset obtained from MySQL that goes like this: Array ( [0]
I need to insert data from my parsed XML file to mySQL table. Problem

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.