|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30104 Error of the function "basename()"
Submitted: 2004-09-16 07:43 UTC Modified: 2004-09-16 12:24 UTC
From: lp at zy165 dot com Assigned:
Status: Not a bug Package: Directory function related
PHP Version: PHP-5.0.1 OS: Linux RH 9
Private report: No CVE-ID: None
 [2004-09-16 07:43 UTC] lp at zy165 dot com
I am Chinese. I love linux, php very much.
So I do many things using php.
But tody, i find an error of the function "basename()"
so that i can't continue writing code by php.
The error like this:
if the $path in function basename($path) contain the Chinese, then the result will be error.
The error appears only in php-5.0.1, before the version it works normally.
Please e-mail me after you see the letter, thank you very much.

Reproduce code:
//Here the $path means "/home/httpd/I/Love/You.php",and "I love you" is translated to Chinese.
$str1=basename ($path,".php");
$str2=basename ($path);
echo $path."<br>1:".$str1."<br>2:".$str2;

$str3=basename ($path2);
echo "<br><br>".$path2."<br>3:".$str3;

$str4=basename ($path3);
echo "<br><br>".$path3."<br>4:".$str4;

Expected result:



Actual result:




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-16 08:34 UTC]
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Duplicate of #30105
 [2004-09-16 12:24 UTC] lp at zy165 dot com
My Expected result should exchange with Actual result.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 13 07:01:34 2024 UTC