3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://mydomain.com/u/123-test'; $url = parse_url($url, PHP_URL_HOST); //$url is POST from input field $domain = array('mydomain.com', 'mydomain.net'); if (!in_array($url, $domain)) { echo 'invalid URL'; }else{ echo 'valid URL'; } ?>

preferences:
26.36 ms | 405 KiB | 5 Q