[英]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、abc3... abcN,我想将此值作为无序列表检索,
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.您必须做两件事。
For that you can use, eg.为此,您可以使用,例如。 PDO library. PDO库。
To achieve it you need only one function, explode() .要实现它,您只需要一个函数, explode() 。
$array = explode(', ', $commaSeparatedData);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.