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;

preferences:
54.06 ms | 406 KiB | 5 Q