Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

wildcard in php

23 views
Skip to first unread message

Onno Dreischor

unread,
Jan 14, 2014, 9:39:32 AM1/14/14
to
I would like to find in a directory files that have a specified
character in common. In DOS that would go with P*.jpg etc. Is there an
equivalent in php?
(I know about opendir, readdir and closedir)
Thank you,
Onno

Jerry Stuckle

unread,
Jan 14, 2014, 10:12:30 AM1/14/14
to
http://www.lmgtfy.com/?q=+php+file+search+wildcard

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstu...@attglobal.net
==================

Onno Dreischor

unread,
Jan 14, 2014, 10:35:57 AM1/14/14
to
Jerry Stuckle schreef op 14-1-2014 16:12:
> On 1/14/2014 9:39 AM, Onno Dreischor wrote:
>> I would like to find in a directory files that have a specified
>> character in common. In DOS that would go with P*.jpg etc. Is there an
>> equivalent in php?
>> (I know about opendir, readdir and closedir)
>> Thank you,
>> Onno
>
> http://www.lmgtfy.com/?q=+php+file+search+wildcard
>
Thank you. Of course I have been searching. The problem always is asking
the right question. Thank you again.
Onno

robamm...@gmail.com

unread,
Dec 19, 2019, 7:46:48 AM12/19/19
to
As far as I remember it should be just "."


Kristjan Robam

Max Mustermann

unread,
Dec 27, 2019, 11:14:40 AM12/27/19
to
another way is using glob as replacement for opendir


<?php
foreach (glob("*.txt") as $filename) {
echo "$filename - Größe: " . filesize($filename) . "\n";
}
?>

0 new messages