我正在寻找一个可以从任何 Drupal 视图中显示导出的 JSON(PHP 风格)数据的查看器?
众所周知,当您(在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它不是“PHP 样式 JSON”(我很确定这样的东西不存在),它是一个 PHP 数组!
要么获取 视图数据源模块,它可以本机将视图导出为 JSON/XML,或者简单地通过运行 PHP 输出
json_encode()
。如果输出如下所示:
那么您需要运行
$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:
Then you need to run
$string = json_encode($view); echo $string;
.That will output the View as a JSON object/array :-)