简体   繁体   中英

Comma separated value in unordered list php

I have Value in table like abc1, abc2, abc3... abcN, I want to retrieve this value as a unordered list,

  • abc1
  • abc2

I m not a expert so please explain me if possible, how i can get it in unordered list.

I want to retrieve data from database table

I have no code, But I want to do it like as i asked, If any one can help with it, I just need code for it, i have db connection..etc, I need help how i can get it this way (unordered list) from database.

Thanks,

There are two things that you have to do.

  1. Fetch data from database.

For that you can use, eg. PDO library.

  1. Explode your data by comma.

To achieve it you need only one function, explode() .

$array = explode(', ', $commaSeparatedData);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM