Get Specific Files (Only Specific Extension Type All Files in Loop ) from Media

You don’t need to use strpos() to figure out the extension because you’ve already parsed the URL above and stored the extension in $AllAtachmentURLextension, so all you need to do is

//for Specific Extensions
if( 'docx' == $AllAttachmentURLextension ) {
  // docx handling here
}
elseif ( 'pdf' == $AllAttachmentURLextension ) {
  // pdf handling here
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)