Friday, 30 August 2013

Notice: Undefined offset: 1 (fopen)

Notice: Undefined offset: 1 (fopen)

What is wrong?
<?php
$url = "http://www.adress.com/lorem-ipsum-dolor";
$page = fopen($url, 'r');
$content = "";
while (!feof($page)) {
$buffer = trim(fgets($page, 4096));
$content .= $buffer;
}
$start = 'first":"';
$end = '","second"';
preg_match("/$start(.*)$end/s", $content, $match);
$mytext = $match[1];
echo "$mytext";
?>
I get this error:
Notice: Undefined offset: 1 in C:\Program Files\EasyPHP-12.1\www\da.php on
line 14

No comments:

Post a Comment