Taking some baby steps in php.
Here is my simple code...
<?php
$data = file_get_contents('http://www.blankwebsite.com');
//$regex = '/<TITLE>(.+?)\<\/TITLE\>/';
$regex = '/TITLE>(.+?)TITLE/';
preg_match($regex,$data,$match);
echo "blah";
echo "<br>";
echo $match[1];
?>
The target source is basically this...
<HEAD>
<TITLE>Blank website. Blank site. Nothing to see here.</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="keywords" CONTENT="blankwebsite, blank website">
<META NAME="description" CONTENT="This resource is provided as a free service for those patrons looking for nothing.">
<META NAME="Author" CONTENT="Traffic Names Ltd. 1999-2014 - http://www.dotcomagency.com - descriptive website names">
<META NAME="Copyright" CONTENT="Traffic Names Ltd. 1999-2014 - http://www.dotcomagency.com - descriptive dotcom domain names">
<LINK rel='stylesheet' type='text/css' href='/names/sitestyle.css'>
</HEAD>
My question is why I get the same result with both the regex used and the regex commented out?
which is...
blah
Blank website. Blank site. Nothing to see here.
Thanks for reading.