I am trying to run a path "/images/thumbs/." through a filter to yield ".". Please do not give me an RTFM. I have, and for some reason it is too cryptic for me tonight. This pattern syntax is driving me mad.
This is doing the job, but I really don't know why. I'd like to simplify the pattern and understand it, too.
$i = 0;
foreach (glob('images/thumbs/*') as $dirfile) {
$file = preg_replace("'\i[\/\!]*?[^<>]*?\/[\/\!]*?[^<>]*?\/'si", "", $dirfile);
echo "".$file." size ".filesize($dirfile)."<br>\n";
$thumb[$i] = $file;
$i++;
}
That big long ugly string for the pattern, "'i[/!]?[<>]?/[/!]?[<>]?/'si", is absolutely greek to me. I just ripped it off of the manual to see if it would work. Although it works, I prefer to know what I am doing. Please help me.
Thank you kindly,
Herk