【发布时间】:2014-02-21 11:11:15
【问题描述】:
我在 jquery mobile 中有一个选择菜单,我想在用户选择一个选项时显示另一个网站的表格,但是当用户选择不同的选项时表格需要更改。
我正在使用简单的 HTML dom 解析器,但我想知道如何将所选选项的值添加到 url,所以如果用户选择值为 32 的选项,它会将 32 添加到 url 以便PHP 代码中使用的 url 将是“http://www.generalconvention.org/gc/deputations?diocese_id=32”。如何使用 PHP 做到这一点?
<?php
include('simple_html_dom.php');
// get DOM from URL or file
$html = file_get_html('http://www.generalconvention.org/gc/deputations?diocese_id=');
// Find all tables
foreach($html->find('table') as $element)
echo $element;
?>
【问题讨论】: