Help for this page

Select Code to Download


  1. or download this
    $ext="\.htm";
    if($file=~ /$ext$/){
         #Extension is at end of file
         # The final $ matches the end of the string.
    }
    
  2. or download this
    if((index ($filename, $ext) + 1 + length($ext))==length($filename)){
          #Extension was at end of $filename
          #Untested, I might be off by one
    }