我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何在php数组中显示值?

I have a this:

$output = print_r($feedDrive, true);

But I just want the actual values, not the commas, or [0] => etc.

How can I do this?

There is foreach loop in php. You have to traverse the array.

foreach($array as $key => $value)
{
  echo $value;
}

If you simply want to add commas between values, consider using implode

$string=implode(",",$array);
echo $string;

近期文章

  • 如何在一台服务器(Apache)中运行PHP和Perl程序
  • Laravel - 将.txt文件保存到mySQL数据库
  • 如何用户输入php
  • 如何访问XML响应
  • 在composer的自动加载器中不存在的类
  • 在Laravel 5.2中显示表格数据
  • 处理输入=“文件”数组
  • 从php文件中调用并显示文本文件
  • Laravel文件扩展名为数组值
  • 格式[H:i]两次之间的小时数差异
  • 使用Jquery Ajax PHP实时显示数据表
  • 如何从php中的复选框中的文本框中获取值
  • PHP没有将表单发送到MySQL数据库
  • Laravel MySQL:将SQL查询转换为Laravel Eloquent
  • password_verify()期望参数2为字符串
  • 创建使用其他工厂构建最终具体对象的工厂实现是一种好习惯吗?
  • 将SQL列值保存到数组
  • 解析PHP - 查询Relation类
  • 表单验证输出无效
  • 我的WP LOOP脚本中的Ghost post_title

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华