in that case
$rmdirr($dirname);
should be
rmdirr($dirname);
Functions shouldnt have a $ in front of them, thats only for variables.
PHP lets you get away with it because there is something called "variable functions" which let you call a function based on a variable.
For example...
function delete_file($name) {
//......
}
function delete_dir($name) {
//.......
}
function create_file($name) {
//........
}
$action = "create";
$type = "file";
$filename = "myfile.txt";
$action_$type($filename); //evaluates to create_file($filename);
delete_$type($filename); //evaluates to delete_file($filename);
so in your case $rmdirr($dirname) evaluates to ($dirname) since there is no variable $rmdirr. PHP shouldn't really let you do that cause its impossible to call a function that has no name, instead that specific error should be more like a syntax error, but it is how it is.