PHP get file listing including sub directories
问题 I am trying to retrieve all images in a directory, including all subdirectories. I am currently using $images = glob("{images/portfolio/*.jpg,images/portfolio/*/*.jpg,images/portfolio/*/*/*.jpg,images/portfolio/*/*/*/*.jpg}",GLOB_BRACE); This works, however the results are: images/portfolio/1.jpg images/portfolio/2.jpg images/portfolio/subdirectory1/1.jpg images/portfolio/subdirectory1/2.jpg images/portfolio/subdirectory2/1.jpg images/portfolio/subdirectory2/2.jpg images/portfolio