我对 PHP 还很陌生,所以请多多包涵:)
如果将 URL 放入文本区域,然后为每个区域提取元数据,我正在尝试做什么。
我已经制作了脚本,但是当我在文本区域中放置多个 URL 时,它只返回最后输入的 URL 的数据,我想也许你们可以帮助我:)
<form method="POST">
<textarea name="TAData">
</textarea>
<input type="submit" value="submit"/>
</form>
<div id="checkboxes">
<input type="checkbox" name="vehicle" value="PR" /> Show me the PR<br />
<input type="checkbox" name="vehicle" value="KW Tag" /> Show me the KW tag<br />
<input type="checkbox" name="vehicle" value="Title Tag" /> Show me the Title tag<br />
</div>
<div id="checkboxes">
<input type="checkbox" name="vehicle" value="1stH1" /> Show me the 1st H1<br />
<input type="checkbox" name="vehicle" value="2ndH1" /> Show me the 2nd H1 tag<br />
<input type="checkbox" name="vehicle" value="SeedKW" /> Show me Seed KW's<br />
</div>
<div id="nofloat"></div>
<?php
//make the array
$TAarray = explode("\n", strip_tags($_POST['TAData']));
foreach ($TAarray as $key => &$line) { $line = trim($line); }
// get the meta data for each url
$tags = get_meta_tags($line);
unset($tags["content-type"]);
unset($tags["page-type"]);
unset($tags["page-topic"]);
unset($tags["audience"]);
unset($tags["content-language"]);
echo '<tr>';
foreach ($tags as $meta)
{
echo '<td>' . $meta . '</td>';
}
echo '</tr>';
?>