Get the folder content and save into an array // Contenido de una carpeta a un array

/** * Get the folder content and save into an array * @param string $dir * @return array */ function contentDirToArray($dir){ $content = scandir($dir); if(is_array($content)): // Deleting . and .. array_splice($content,0,2); return $content; else: return false; endif; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.