On the <a href line,
needs to be either:
or just (since it looks like you have the shorthand tags enabled):
I'd go with (array is assumed with $varname[] = whatever
, ereg and eregi are deprecated and regardless, the regex's can be combined):
PHP Code:
<?php
$filePath = 'images/photos/';
$dir = opendir($filePath);
while ($file = readdir($dir)) {
if (preg_match("/\.(png)|(jpg)|(gif)$/i", $file)) {
$string[] = $file;
}
}
while (sizeof($string) != 0){
$img = array_pop($string);
?>
<a href="<?php echo "$filePath$img"; ?>" class="galpop" data-galpop-group="gallery"></a>
<?php
}
?>
But you won't see anything on the page, so maybe (gives thumbnail images):
PHP Code:
<?php
$filePath = 'images/photos/';
$dir = opendir($filePath);
while ($file = readdir($dir)) {
if (preg_match("/\.(png)|(jpg)|(gif)$/i", $file)) {
$string[] = $file;
}
}
while (sizeof($string) != 0){
$img = array_pop($string);
?>
<a href="<?php echo "$filePath$img"; ?>" class="galpop" data-galpop-group="gallery"><img border=0 src="<?php echo "$filePath$img"; ?>" height=100></a>
<?php
}
?>
Bookmarks