From:             ninzya at inbox dot lv
Operating system: -
PHP version:      5.3.0RC4
PHP Bug Type:     Feature/Change Request
Bug description:  dirname() to accept path level to return

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 bug report at http://bugs.php.net/?id=48659&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48659&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48659&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48659&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48659&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48659&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48659&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48659&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48659&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48659&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48659&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48659&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48659&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48659&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48659&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48659&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48659&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48659&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48659&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48659&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48659&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48659&r=mysqlcfg

Reply via email to