$path = "/home/www/data/users.txt"; $dirname = dirname($path); // $dirname contains "/home/www/data"?>