Para ello hice un input y puse en onchange lo siguente:
Código :
<?php
    $url = $_POST['artarea'];
    function url_exists($url) {
        $h = get_headers($url);
        $status = array();
        preg_match('/HTTP\/.* ([0-9]+) .*/', $h[0] , $status);
        return ($status[1] == 200);
    }
    echo url_exists($url)? 'existe' : 'no existe';
?>
<input  type="url" name="artarea" id="artarea" style="opacity: 0.8; border: inset; border-radius: 10px; font-family: segoe script;" required placeholder="Escribe aquí el enlace." onpaste="return paste;" oncut="return false;" oncopy="return false;" onchange="<?php echo validar_url(); ?>">Llama a una función php mediante onchange según lo que he oído está mal el onchange="<?php echo validar_url(); ?>" creo. ¿Y si es así como lo puedo llamar a la función validar_url()?
Gracias de antemano
