A
Anonymous
Guest
Hi,
I have a simple question.
Heres my code:
This is the file:
The code works, however the output (Title) is displayed twice.
Any suggestions to why?
Heres the output:
I have a simple question.
Heres my code:
Code:
<?php
$filename = "testfile.php";
$contents = file_get_contents($filename);
if (preg_match('~<title>(.*?)</title>~', $contents, $title))
{
$text = implode(" ",$title);
echo strip_tags($text);
}
?>
This is the file:
Code:
<html>
<title>Testfile</title>
<body >
<h3><b>This is the headline</b></h3>
<p>And this is some text</p>
</body>
</html>
The code works, however the output (Title) is displayed twice.
Any suggestions to why?
Heres the output:
Testfile Testfile