Jump to content

glob command on specific directory for specific string


Darkmatter5

Recommended Posts

How do you use the GLOB_NOCHECK flag in glob?

 

I've been trying this, but it's not working and I'm not sure what glob is returning if no files are found.

if(glob("images/logos/g" .$item. "*-small.png",GLOB_NOCHECK)=="images/logos/g" .$item. "*-small.png") { echo "<img src='images/logos/noimage.png'>"; }
else {
  foreach(glob("images/logos/g" .$item. "*-small.png") as $filename) {
    $full=str_replace("small","full",$filename);
    echo "<a href='$full' target='_blank'><img style='display: inline;' src='$filename'></a> ";
  }
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.