<?php $file = file_get_contents('index.html', true); var_dump(preg_match("/\<a.*\>(.*?)\<\/a\>/si", $file)); $pathToFile = $_SERVER['DOCUMENT_ROOT'] . 'index.html'; if (file_exists($pathToFile)) { $GetContentFile = []; $GetContentFile = file_get_contents($pathToFile); $t = preg_match("/\<a.*\>(.*?)\<\/a\>/si", $GetContentFile); echo $t; }