2
I am using PHP, and in a server folder contain files with these names:
T3497012@16-01-02:21@[email protected]
T3497012@16-01-02:22@[email protected]
T3497012@16-01-02:23@[email protected]
T3497012@16-01-02:24@[email protected]
T3497012@16-01-02:25@[email protected]
T3497012@16-01-02:26@[email protected]
T3497012@16-01-02:27@[email protected]
T3497012@16-01-02:28@[email protected]
T9997012@16-01-02:29@[email protected]
T1997012@16-01-02:30@[email protected]
T1997012@16-01-02:31@[email protected]
T9997012@16-01-02:32@[email protected]
T9997012@16-01-02:33@[email protected]
every word of this among the @
means something by analyzing the first file for example:
T3497012@16-01-02:21@[email protected]
T3497012
is the id of the user who saved the file, 16-01-02:21
is the date and time he did it, GEOTIMBRAG1A
is the name of the host Disco
the type and .json
is the file extension.
i need to assign to an array all filenames that are from id T9997012
being like this:
$array[0] = "T9997012@16-01-02:29@[email protected]";
$array[1] = "T9997012@16-01-02:32@[email protected]";
$array[2] = "T9997012@16-01-02:33@[email protected]";
I tried to use preg_match() but could not.
I also need an array with all the hosts (GEOTIMBRAG1A) of all the files of an id. later I will need an array with all type (disk, Panserver) of an id.
think the glob command should help $files = glob("/path/to/directory/* geotimbering*.*");
– Arsom Nolasco