回声数组作为列mysqli? [英] echo array as column mysqli?

查看:39
本文介绍了回声数组作为列mysqli?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一个学校项目制作食谱站点,并且试图从mysqli的数据库中回显出两列数组.

I am working on a recipe site for a school project, and I am trying to echo out two columns of arrays from my database in mysqli.

数组如下所示:

当我回声它们时,我也希望它们看起来像这样:

And when I echo them out I would like them too look like this:

我确实在所有地方都试图找到并回答.

I have literally tried everywhere to find and answer.

我的数据库名称是"opskriftreg",并且与它的连接有效,其余代码出来了.

My database name is "opskriftreg", and the connection to it works, the rest of the code comes out.

推荐答案

您可以使用 explode 制作一个数组,

You can use explode to make an array of it,

示例:

$data = "hi,hello,helooo";
$my_array = explode($data);
foreach($my_array AS $value)
{
    echo $value."<br />";
}

这篇关于回声数组作为列mysqli?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆