This will do what you want
$strFNameLength=strlen($strString);
for($i=$strFNameLength-4;$i<$strFNameLength;++$i) $strCheck1.=$strString[$i];
$strCheck2=$strString[$strFNameLength-5].$strCheck1;
if(($strCheck1=='.htm')||($strCheck1=='.zip')||($strCheck2=='.html')) $strType='File';
else $strType='Folder';
I can't figure out how to keep the logic the same but so far I have
/* no longer necessary
$strFNameLength = strlen($strString);
$strLengthtoRemove1 = ($strFNameLength - 4);
$strLengthtoRemove2 = ($strFNameLength - 5);
*/
$strCheck1 = /*can't figure out how to do this Right($strString,'4'/*strlen($strString)-$strLengthtoRemove1 works also*/)
$strCheck2 = /*can't figure out how to do this Right($strString,'5'/*strlen($strString)-$strLengthtoRemove2 works also*/)
Edit:closing tags