摆脱<pre> to put json in html table

时间:2016-04-12 00:26:28

标签: php json

I was told to get rid of the pre first and then I will be able to put the json in the html table. I searched how to remove pre tags or to unwrap json but I can't seem to find the right answer. Thanks!

<?php
include "lib/webdesign.php";
include "lib/lib.php";

$url = "http://10.0.0.1/lib/api/desk/";

$params = array ("action" => "list","company_key" => "1");

$result=requestURL($url,$params);

echo "Result:".$result."<br/>";
?>

2 个答案:

答案 0 :(得分:1)

$result = strip_tags(requestURL($url,$params));
echo ("Result {$result} <br/>");

答案 1 :(得分:0)

strip_tags()在这里工作得很好。