Edit report at https://bugs.php.net/bug.php?id=48659&edit=1
ID: 48659 Comment by: ajfweb at googlemail dot com Reported by: ninzya at inbox dot lv Summary: dirname() to accept path level to return Status: Open Type: Feature/Change Request Package: Feature/Change Request Operating System: - PHP Version: 5.3.0RC4 Block user comment: N Private report: N New Comment: This is ancient, but this should be closed. It's completely unnecessary, .. exists. Previous Comments: ------------------------------------------------------------------------ [2009-06-23 10:47:18] ninzya at inbox dot lv Description: ------------ It would be great if dirname() function had a second parameter, let's say - uint $level, which would mean "how many path levels to strip off". By default this parameter could be set to 1 to not to break the backwards compatibility. Reproduce code: --------------- <?php $path ='/var/www/localhost/public_html/tpl/'; echo dirname( $path);// /var/www/localhost/public_html echo dirname( $path, 2);// /var/www/localhost echo dirname( $path, 3);// /var/www/ echo dirname( $path, 4);// /var echo dirname( $path, 5);// . echo dirname( $path, 6);// . ?> Expected result: ---------------- Expect this feature to be implemented Actual result: -------------- - ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=48659&edit=1