3v4l.org

run code in 300+ PHP versions simultaneously
<?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;
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
http://en.wikipedia.org/w/api.php?action=query&prop=extracts%7Cinfo&titles=Some+example&format=json&explaintext=&redirects=&inprop=url&indexpageids=

preferences:
75.18 ms | 406 KiB | 5 Q