I have a php code in which I want to extract a title from a file in php.
$good_title = ExtractGoodTitle("good/web/gooddump/GOOD_2.html"); // Line A
function ExtractGoodTitle($filename)
{
.
.
.
.
return $title;
}
The function ExtractGoodTitle($filename) extracts a title from the file GOOD_2.html I haven't included code in the function as my question is related to Line A. In the gooddump directory, following files are present:
- GOOD_2.html
- GOOD_3.html
- GOOD_4.html
.
.
.
. - GOOD_740.html
Problem Statement:
I am wondering what changes I need make at Line A as GOOD_2.html file may or may not be present in the gooddump directory. Looking for a dynamic solution.