如何在html/php中使用选择器值发布多个值
我想知道如何发布基于json的对象字段如何在html/php中使用选择器值发布多个值,php,html,post,Php,Html,Post,我想知道如何发布基于json的对象字段 <?php $jsondata = file_get_contents('https://newsapi.org/v1/articles?source=google-news&sortBy=top&apiKey=xxxxxxx'); $data = json_decode($jsondata, true); $tasks = $data['articles']; foreach ( $tasks as $task) { $
<?php
$jsondata = file_get_contents('https://newsapi.org/v1/articles?source=google-news&sortBy=top&apiKey=xxxxxxx');
$data = json_decode($jsondata, true);
$tasks = $data['articles'];
foreach ( $tasks as $task) {
$news_title = $task['title'];
$news_url = $task['url'];
$news_imagUrl = $task['urlToImage'];
echo "<option value='".$task."'>".$news_title."</option>"; }
?>
你的问题不清楚。请举例说明您是否试图用html制作表单?