<?php
$imgpath = "thumbs";
$imgpath2 = "fullphoto";
$handle = opendir( "$imgpath" );
$handle2 = opendir( "$imgpath2" );
$imgArray = array();
while($file = readdir($handle))
{
if( $file != "." && $file != ".." )
{
array_push( $imgArray, $file );
}
}
closedir( $handle );
closedir( $handle2 );
mt_srand( (double)microtime( ) * 1000000 );
$randval = mt_rand( 0, sizeof( $imgArray ) - 1 );
echo "<td align=center><a href=\"$imgpath2/" . $imgArray[ $randval ] . "\" onclick=\"window.open(this.href, 'popupwindow', 'height=605,width=405,scrollbars,resizable'); return false;\"><BR><img border=0 SRC=\"$imgpath/" . $imgArray[ $randval ] . "\"><br /> </a></td>";?>
How to get filename without extension? to echo it like image headline....