我使用phppageBuilder编辑我的页面html内容,并在MySQL的Pages表中保存以下json生成的代码:
{"html":["[block slug=\"contact\" id=\"IDL8P4JHM1GYPVX0\"]"],"components":[[{"tagName":"phpb-block","content":"","attributes":{"slug":"contact","id":"IDL8P4JHM1GYPVX0"}}]],"css":"* { box-sizing: border-box; } body {margin: 0;}","style":[],"blocks":{"en":{"IDL8P4JHM1GYPVX0":{"settings":{"attributes":{"style-identifier":"IDL8P4QRULUOPXC0"}},"blocks":[],**"html":** <- all page html is here
我需要提取最后一个"html":data后的"块":[],以检索我的所有html代码输出到我的php主页.
PHP主页输出:
$s = mysqli_query($db,"SELECT `data` FROM `pages` WHERE `id` = 1");
$row = mysqli_fetch_array($s);
echo $row['data'];
但我得到了所有的JSON代码.我只需要从建造者那里得到我的html代码.
Phppagebuder来源:https://github.com/HansSchouten/PHPagebuilder