Jump to content

Search the Community

Showing results for tags 'glob'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 3 results

  1. Hi all I am trying to display a list of images contained withina folder. I am using the following code <?php //Path to folder which contains images $dirname = $shopConfig['url'].'images/flags/'; //echo $dirname; //Use glob function to get the files //Note that we have used " * " inside this function. If you want to get only JPEG or PNG use //below line and commnent $images variable currently in use print_r(glob($dirname."*")); $images = glob($dirname."*.png"); //Display image using foreach loop foreach($images as $image){ //print the image to browser with anchor tag (Use if you want really ) echo '<a href="'.$image.'" target="_blank"><img src="'.$image.'" height="100" width="100" /></a>'; } ?> I know there are images within the folder, however when I print the array it is empty. Can anyone point out what is wrong with the code and where I have gone wrong? Thanks
  2. Hello I have several json files in one directory. i would like to merge them in to one. I did something like this <?php foreach (glob("../json/*.json") as $filename) { echo basename($filename) . "\n"; } $res1 = file_get_contents($filename); echo $res1; ?> But it echoes only the last (the first echo is to view all files which is not important here) Then I tried many versions of foreach inside foreach with no success. Like this: <?php foreach (glob("../json/*.json") as $filename) { foreach (file_get_contents($filename) as $a) { } } echo $a; ?> So I appreciate a little help here, thank you.
  3. I am running php 5.4, IIS 7.5 on WinServer 2008 R2 box. I want to retrieve all subfolder names in a directory using PHP. I can successfully perform this task IF the target folder exists on the same drive as the php code, which is on c:\. However, I need to retrieve subfolder names from the e:\ drive on the same server. I have the permissions properly set for IUSR and IIS_IUSRS (read & exe, modify) for the target and parent folders but of course I don't have those permissions all the way to the root of e:\ drive. Using scandir(), I get "Access is denied. (code: 5)" but I have tried glob() and RecursiveDirectoryIterator to no avail. I have not been able to find a solution or an example so perhaps it is not possible. Any recommendations are greatly appreciated.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.