- Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14
- http://en.wikipedia.org/w/api.php?action=query&prop=extracts%7Cinfo&titles=Some+example&format=json&explaintext=&redirects=&inprop=url&indexpageids=
<?php
$parsed_url = parse_url($url =
"http://en.wikipedia.org/w/api.php?action=query&prop=extracts|info&titles=**VARIABLE**&format=json&explaintext&redirects&inprop=url&indexpageids");
$params = [];
parse_str($parsed_url['query'], $params);
$title = 'Some example';// $data->query->pages->$pageid->title;
$params['titles'] = $title;
$parsed_url['query'] = http_build_query($params);
$url = $parsed_url['scheme'] . '://' . $parsed_url['host'] . $parsed_url['path']. '?' . $parsed_url['query'];
echo $url;