标签:com nbsp 路径 upload basename http dir filename div
$file = ‘http://img.ecobd2.com/upload/pro/ktm-flash-200.jpg‘; $path_parts = pathinfo($file); echo ‘目录名称‘ . $path_parts[‘dirname‘], ‘<br/>‘; // img.ecobd2.com/upload/pro echo ‘文件全名‘ . $path_parts[‘basename‘], ‘<br/>‘; // ktm-flash-200.jpg echo ‘文件后缀‘ . $path_parts[‘extension‘], ‘<br/>‘;// jpg echo ‘文件名称‘ . $path_parts[‘filename‘], ‘<br/>‘; // ktm-flash-200 // PHP >= 5.2.0 echo ‘目录名称‘ . pathinfo($file, PATHINFO_DIRNAME), ‘<br/>‘; // img.ecobd2.com/upload/pro echo ‘文件全名‘ . pathinfo($file, PATHINFO_BASENAME), ‘<br/>‘; // ktm-flash-200.jpg echo ‘文件后缀‘ . pathinfo($file, PATHINFO_EXTENSION), ‘<br/>‘;// jpg echo ‘文件名称‘ . pathinfo($file, PATHINFO_FILENAME), ‘<br/>‘; // ktm-flash-200 // PHP >= 5.2.0
标签:com nbsp 路径 upload basename http dir filename div
原文地址:https://www.cnblogs.com/aid12580/p/10489113.html