我有桌子:
==============
|id| document|
==============
|1 | doc1.txt|
|2 | doc2.txt|
==============
我想得到document
没有扩展名的。这是我的代码:
$query = mysql_query("SELECT document FROM tb ") or die(mysql_error());
while ($row = mysql_fetch_array($query)) {
$filename = $row['document'];
$title = basename($filename);
}
但结果$title
仍然包含扩展名。怎么了?谢谢你