$value){ $path = realpath('img'.DIRECTORY_SEPARATOR.$value); if(is_dir($path) && $value != "." && $value != "..") { $path = preg_replace('/^\d+_/', '', $value); $name = str_replace("_", " ", $path); $results[] = (object) ['dir' => $value, 'path' => $path, 'name' => $name]; } } $results[] = (object) ['dir' => 'sobre', 'path' => 'sobre', 'name' => 'contato']; return $results; } function imagens($dir, &$results = array()){ $root = realpath('img'.DIRECTORY_SEPARATOR.$dir); $files = scandir($root); foreach($files as $key => $value){ $path = realpath($root.DIRECTORY_SEPARATOR.$value); if(!is_dir($path)) { list($width, $height) = getimagesize($path); $results[] = (object) ['name' => $value, 'width' => $width, 'height' => $height]; } } return $results; } function procura_secao($procurada) { global $secoes; foreach($secoes as $value){ if ($procurada == $value->path) { return $value; } } return false; } $secoes = lista_secoes(); include("header.php"); $param = $_GET['nome']; if ($param == NULL || $param == "") { // HOME -------------------------------- ?>