3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_title($url){ $str = file_get_contents($url); if(strlen($str)>0) { preg_match("/<title\>(.*)\<\/title\>/i", $str, $title); $title = "Title: " . $title[1] . "<br>"; return $title; } } function get_meta($url) { $meta = get_meta_tags($url); $description = "Description: " . $meta['description'] . "<br>"; $keywords = "Keywords: " . $meta['keywords'] . "<br>"; return [$description, $keywords]; } function get_header($url){ $str = file_get_contents($url); if(strlen($str)>0) { preg_match("/<h1.{31}>(.*)\<\/h1\>/i", $str, $header); $header = "H1: " . $header[1] . "<br>"; return $header; } } $meta = get_meta("https://hotels24.ua/"); echo get_title("https://hotels24.ua/"); echo $meta[0]; echo $meta[1]; echo get_header("https://hotels24.ua/");

preferences:
169.97 ms | 406 KiB | 5 Q