not understanding you...
if the string ends in '.html' then what is there to dump the rest of?... or do you mean the beginning?..
to test if there is '.html' in a string you could do:
<?
if(strpos($string, '.html') != 0) {
echo(".html does exist in string (return true)");
} else {
echo(".html does not exist in string (return false)");
}
?>
will return true on following strings:
*.html
.html***
*.html
if you are testing only the end of the line you will have to do it a little different but it would be easier:
<?
$tmp = trim($string);
$sl = strlen($string);
$last = ($tmp[($sl - 5)]) . ($tmp[($sl - 4)]) . ($tmp[($sl - 3)]) . ($tmp[($sl - 2)]) . ($tmp[($sl - 1)]);
if($last == ".html") {
echo("extension is .html (return true)");
} else {
echo("extension is not .html (return false)");
}
?>
**neither of those little scripts are tested by me - might take a little tweaking to get it perfect but its a general idea of what you might want to do or try