从json打印PHP文本

从json打印PHP文本,php,Php,Wikipedia API中有这样一个json: 如何在php中从短文本开始的php字段输出文本 我试过这样做,但没有任何效果: $url = file_get_contents('https://ru.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro&explaintext&redirects=1&titles=Apple'); $yummy = jso

Wikipedia API中有这样一个json:

如何在php中从短文本开始的php字段输出文本

我试过这样做,但没有任何效果:

$url = file_get_contents('https://ru.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro&explaintext&redirects=1&titles=Apple'); 
$yummy = json_decode($url, true); 
echo $yummy['extract'];

像这样做,我调试您在查询>页面>编号中提取

$url = file_get_contents('https://ru.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro&explaintext&redirects=1&titles=Apple'); 
$yummy = json_decode($url, true); 
$datas=$yummy['query']['pages'];

foreach($datas as $data){
  $extract =  $data['extract'];
}

echo $extract;
考试没问题

  $url = file_get_contents('https://ru.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro&explaintext&redirects=1&titles=Apple'); 
$yummy = json_decode($url, true); 
$yummys=$yummy['query']['pages'];
foreach($yummys as $yummy)
  echo $yummy['extract'];

谢谢!如果号码39726发生变化,如何自动取款?我不知道那个号码是什么,但它应该是动态的。所以我认为从你的角度来看,你可以传递这个动态数字
$yummy['query']['pages'][$number]['extract']这不起作用:(数字不断变化)您的页面数组将是多个?