【发布时间】:2012-12-31 06:35:41
【问题描述】:
我怎样才能只返回文件名。 $image 正在打印绝对路径名?
<?php
$directory = Yii::getPathOfAlias('webroot').'/uploads/';
$images = glob($directory . "*.{jpg,JPG,jpeg,JPEG,png,PNG}", GLOB_BRACE);
foreach($images as $image)
echo $image
?>
我想要的只是特定目录中的文件名而不是绝对名称。
【问题讨论】: