我正在寻找一个可以从任何 Drupal 视图中显示导出的 JSON(PHP 风格)数据的查看器?

发布于 2024-12-13 13:52:07 字数 285 浏览 3 评论 0原文

众所周知,当您(在 Drupal 中)单击视图(例如客户数据等)时,会有一个导出“按钮”。所以我想以某种方式可视化我在这里得到的数据(不幸的是 PHP 风格的 JSON 对象)。大多数观众和读者(例如这里 http://jsonviewer.stack.hu/ 或其他一些软件解决方案)不能读取这种类型的 JSON!
我知道可以在 php 中解析此导出的 JSON 数据,但我正在寻找更友好的解决方案。

谢谢你! 乔治

As you all know there is an Export "Button" when you Click(in Drupal) on your View(e.g. Customer Data etc.). So I'd like to visualize somehow the data I geht here(which is unfortunately JSON Objects in PHP Style). Most Viewers & Readers (e.g. this here http://jsonviewer.stack.hu/ or some other SW solutions) can't read this Type of JSON!

I'm aware of the possibility of parsing this Exported JSON Data in php but I'm lookin for a more friendly solution.

Thanxx out there!
George

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

留一抹残留的笑 2024-12-20 13:52:07

它不是“PHP 样式 JSON”(我很确定这样的东西不存在),它是一个 PHP 数组!

要么获取 视图数据源模块,它可以本机将视图导出为 JSON/XML,或者简单地通过运行 PHP 输出json_encode()

如果输出如下所示:

$view = array(
  'something' => 'something',
  ...
);

那么您需要运行 $string = json_encode($view);回显 $string;

这会将视图输出为 JSON 对象/数组:-)

It's not 'PHP style JSON' (I'm quite sure such a thing doesn't exist) it's a PHP array!

Either grab the views datasource module which can export views as JSON/XML natively, or simply run the PHP output through json_encode().

If the output looks like this:

$view = array(
  'something' => 'something',
  ...
);

Then you need to run $string = json_encode($view); echo $string;.

That will output the View as a JSON object/array :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文