Hi there,
Could someone tell me what this actually means?
I have my own local server running on my PC and on one include I get this error:
Notice: Undefined offset: 1 in c:\program files\www\inc\header_inc.php on line 21
Line 21 relates to this:
And this is the complete code:
I commented out the error handling in php.ini but the error still is there.
Any ideas?
Thanks
Karl
Could someone tell me what this actually means?
I have my own local server running on my PC and on one include I get this error:
Notice: Undefined offset: 1 in c:\program files\www\inc\header_inc.php on line 21
Line 21 relates to this:
PHP Code:
preg_match('/href="([^"]+)"/', $line, $url);
PHP Code:
<?php
$menu = <<<MENU
<ul>
<li><a href="/" title="Homepage">Home</a></li>
<li><a href="/colophon/" title="All about">Colophon</a></li>
<li><a href="/webdesign/" title="service">Web Design</a></li>
<li><a href="/hosting/" title="hosting packages">Hosting</a></li>
<li><a href="/pcsupport/" title="PC Support">PC Support</a></li>
<li><a href="/contact/" title="Contact information">Contact</a></li>
</ul>
MENU;
$lines = split("\n", $menu);
foreach ($lines as $line) {
$current = false;
preg_match('/href="([^"]+)"/', $line, $url);
if (substr($_SERVER["REQUEST_URI"], 0, 5) == substr($url[1], 0, 5)) {
$line = str_replace('<a h', '<a id="active" h', $line);
}
echo $line."\n";
}
?>
Any ideas?
Thanks
Karl

Comment