Estou querendo pegar uma extensão de um arquivo porem o nome de algumas imagens vem tipo:
adsfasdfasd.234.asdfa.3rfr.jpg
asdfsdafasdfasdf.45eg.png
Estou tentando usar o código:
<?php
if(is_dir("img/$noticia->idnoticia"))
{
$diretorio = "img/$noticia->idnoticia/";
if ($handle = opendir($diretorio)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
list($arquivo, $ext) = explode(strrchr($file,"."),$file);
if(($ext!="mp3")AND($ext!="wav")){
echo "<li><img src='$diretorio$arquivo.$ext'></li>";
Porem o resultado esta sendo .
.
alguma dica?