我只想显示文件名而不显示URL。我想替换文件名而不是'document'。
while($fet=mysql_fetch_assoc($sql1))
{
$i=$i+1;
$next=$fet['f_name'];
echo '<h4><a class="astext" href="'.$next.'" title="'.$next.'" target="_blank" download>Document'.$i.'</a></h4>';
}
如果我将“文档”一词替换为$ next,则它将完整的URL显示为http://www.sample/txt/1/sample.doc,我需要显示sample.doc。
echo '<h4><a class="astext" href="'.$next.'" title="'.$next.'" target="_blank" download>"'.$next.'"</a></h4>';
我包括$ next1 = basename($ next);
while($fet=mysql_fetch_assoc($sql1))
{
$i=$i+1;
$next=$fet['f_name'];
$next1 = basename($next);
echo '<h4><a class="astext" href="'.$next.'" title="'.$next.'" target="_blank" download>'.$next1.'</a></h4>';
}
现在正在工作。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句