3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url = "http://konachan.com/image/5903a59a96d009821954319810a438fd/Konachan.com%20-%20198471%20apple%20aqua_%28kono_subarashii_sekai_ni_shukufuku_wo!%29%20bed%20blue_eyes%20blue_hair%20food%20fruit%20kono_subarashii_sekai_ni_shukufuku_wo!%20kurripu%20long_hair.png"; $url2 = urldecode($url); $url3 = explode('/', $url2); $last = array_pop($url3); $url3 = implode('/', $url3); $url3 .= '/'.urlencode($last); var_dump(rawurlencode($url2)); var_dump(filter_var($url, FILTER_VALIDATE_URL), filter_var($url2, FILTER_VALIDATE_URL), filter_var($url3, FILTER_VALIDATE_URL));
based on nQUhv
Output for 5.5.0 - 7.3.1
string(272) "http%3A%2F%2Fkonachan.com%2Fimage%2F5903a59a96d009821954319810a438fd%2FKonachan.com%20-%20198471%20apple%20aqua_%28kono_subarashii_sekai_ni_shukufuku_wo%21%29%20bed%20blue_eyes%20blue_hair%20food%20fruit%20kono_subarashii_sekai_ni_shukufuku_wo%21%20kurripu%20long_hair.png" string(256) "http://konachan.com/image/5903a59a96d009821954319810a438fd/Konachan.com%20-%20198471%20apple%20aqua_%28kono_subarashii_sekai_ni_shukufuku_wo!%29%20bed%20blue_eyes%20blue_hair%20food%20fruit%20kono_subarashii_sekai_ni_shukufuku_wo!%20kurripu%20long_hair.png" bool(false) string(236) "http://konachan.com/image/5903a59a96d009821954319810a438fd/Konachan.com+-+198471+apple+aqua_%28kono_subarashii_sekai_ni_shukufuku_wo%21%29+bed+blue_eyes+blue_hair+food+fruit+kono_subarashii_sekai_ni_shukufuku_wo%21+kurripu+long_hair.png"