I need to check the files inside a folder contains '_'
symbol. I have used the glob function to get the files from server location. But I am unaware to check the filenames contains the symbol anywhere within the filename.
I have files having names like the following format. student_178_grade1A
I have done like this.
$report_files=glob( '/user_uploads/' . '/reportcards/' . 'term' . '_' . 10.'/*'.'.pdf' );
//this will return all files inside the folder.
if(count(report_files)>0)
{
//some stuff
}
else
{
}
I need to get the files which has '_' within the filename.I tried
glob( '/user_uploads/' . '/reportcards/' . 'term' . '_' . 10.'/*[_]'.'.pdf' );
but its not working