$path = "./test.txt"; $filename = basename($path); $filename2 = basename($path, ".txt"); echo $filename; echo ""; echo $filename2;?>