Saturday, 24 August 2013

Display all file with prefix id

Display all file with prefix id

I have user folder /folder_name and there are files with name prefix
Example this pattern id_radom.example
5__1490952185fed525d92.24525311.jpg
15__4658521860030a66d0.90328377.jpg
15__6654521861778060e1.31100475.jpg
15__6654521861778060e1.31100475.jpg
I want to display all of these image(id=15) using php
I am trying:
$path = "uploads/registered_files/".$_SESSION['user_data']['username'];
$a = glob("/".$path."/".$article->article_id."__",GLOB_BRACE);
print_r($a);
But I got empty array()

No comments:

Post a Comment