关于glod方法的使用和介绍

<--{吃一堑,长一智}-->
1.glod主要是用来查找文件的;
2. 查找所有后缀名为php的文件
    e.g.<?php
    $file=glob('*.php');
    ?>  
3.查找以什么字母开头/结尾(区分大小写)的后缀名为什么的文件
    e.g.<?php
    $files = glob(‘../images/a*.jpg’);
    ?>
    <?php
    $files = glob(‘../images/*e.jpg’);
    ?>
4.你还可以加上相对路径查找:
    e.g.<?php
    $files = glob(‘../images/*.jpg’);
    ?>
5.可以得到文件的绝对路径
    e.g.<?php
    $files = glob(‘../images/*.jpg’);
    $file=array_map('realpath',$files);
    print_r($file);
    ?>

原文地址:https://www.cnblogs.com/S-Ping/p/4087578.html