$text = "ahmet.com/deneme/deneme"; preg_match('/(.*?).*?\/(.*?)\/(\S+)/si',$text,$dondur); echo $dondur[3];