PHP funkce glob()

11. 9. 2019

Dostupnost ve verzích: PHP 4.3.0

Find pathnames matching a pattern

Parametry

Parametr Datový typ Výchozí hodnota Poznámka
$pattern string není The pattern. No tilde expansion or parameter substitution is done.
$flags int null Valid flags: GLOB_MARK - Adds a slash to each directory returned GLOB_NOSORT - Return files as they appear in the directory (no sorting). When this flag is not used, the pathnames are sorted alphabetically GLOB_NOCHECK - Return the search pattern if no files matching it were found GLOB_NOESCAPE - Backslashes do not quote metacharacters GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', or 'c' GLOB_ONLYDIR - Return only directory entries which match the pattern GLOB_ERR - Stop on read errors (like unreadable directories), by default errors are ignored. @return array an array containing the matched files/directories, an empty array if no file matched or false on error.

array

an array containing the matched files/directories, an empty array
if no file matched or false on error.



On some systems it is impossible to distinguish between empty match and an
error.

Další zdroje

Oficiální dokumentace funkce glob

Jan Barášek
Jan BarášekVíce o autorovi

Autor článku pracuje jako seniorní vývojář a software architekt v Praze. Navrhuje a spravuje velké webové aplikace, které znáte a používáte. Od roku 2009 nabral bohaté zkušenosti, které tímto webem předává dál.

Rád vám pomůžu:

Související články
PHP funkce cosh()PHP funkce nl2br()PHP funkce acos()PHP funkce imagescale()PHP funkce htmlspecialchars - escapování znakůPHP funkce getimagesize - velikost obrázkuPHP funkce var_export()PHP funkce mail()PHP funkce asin()PHP funkce popen()PHP funkce disk_free_space()PHP funkce cosh()PHP funkce str_ireplace()PHP funkce dechex()PHP funkce exp()PHP funkce hebrevc()PHP funkce strrpos()PHP funkce base_convert()PHP funkce strtoupper()PHP funkce getlastmod()PHP funkce usort()PHP funkce stream_copy_to_stream()PHP funkce disk_total_space()PHP funkce doubleval()PHP funkce stream_get_transports()PHP funkce chmod()PHP funkce stream_get_meta_data()PHP funkce phpversion()PHP funkce strval()PHP funkce imagesetinterpolation()PHP funkce octdec()PHP funkce is_null()PHP funkce imagepalettetotruecolor()PHP funkce str_replace()PHP funkce scandir()PHP funkce ip2long()PHP funkce stream_wrapper_register()PHP funkce md5_file()PHP funkce strtolower()PHP funkce gettype()PHP funkce stream_resolve_include_path()PHP funkce substr_replace()PHP funkce getenv()PHP funkce file_exists()PHP funkce is_file()PHP funkce connection_status()PHP funkce is_callable()PHP funkce basename()PHP funkce setlocale()PHP funkce stream_context_get_default()PHP funkce putenv()PHP funkce stream_set_chunk_size()PHP funkce constant()PHP funkce php_ini_scanned_files()PHP funkce asort()PHP funkce sha1_file()PHP funkce imageflip()PHP funkce usleep()PHP funkce strrev()PHP funkce bindec()PHP funkce dns_check_record()PHP funkce stream_set_timeout()PHP funkce is_finite()PHP funkce getcwd()PHP funkce lcg_value()PHP funkce substr()PHP funkce header()PHP funkce php_uname()PHP funkce fputcsv()PHP funkce abs()PHP funkce stream_filter_remove()PHP funkce unpack()PHP funkce strtok()PHP funkce fsockopen()PHP funkce stream_socket_sendto()PHP funkce atan2()PHP funkce stream_set_write_buffer()PHP funkce atan()PHP funkce log10()PHP funkce is_infinite()PHP funkce settype()PHP funkce define_syslog_variables()PHP funkce chroot()PHP funkce is_resource()PHP funkce ob_get_contents()PHP funkce shuffle()PHP funkce parse_ini_string()PHP funkce stream_set_blocking()PHP funkce ini_get_all()PHP funkce implode()PHP funkce convert_uudecode()PHP funkce cos()PHP funkce hexdec()PHP funkce magic_quotes_runtime()PHP funkce getrusage()PHP funkce acosh()PHP funkce socket_set_timeout()PHP funkce strrchr()PHP funkce syslog()PHP funkce cli_set_process_title()PHP funkce fgetcsv()PHP funkce set_time_limit()PHP funkce ltrim()PHP funkce current()PHP funkce rmdir()PHP funkce gethostbyname()PHP funkce readfile()PHP funkce microtime()PHP funkce ini_alter()PHP funkce strptime()PHP funkce stream_wrapper_restore()PHP funkce count()PHP funkce fgetc()PHP funkce unserialize()PHP funkce stream_socket_server()PHP funkce phpinfo()PHP funkce stream_socket_enable_crypto()PHP funkce clearstatcache()PHP funkce set_file_buffer()PHP funkce move_uploaded_file()PHP funkce chdir()PHP funkce stream_context_set_params()PHP funkce php_logo_guid()PHP funkce compact()PHP funkce crypt()PHP funkce stristr()PHP funkce ob_flush()PHP funkce addslashes()PHP funkce fgetss()PHP funkce show_source()PHP funkce strcspn()PHP funkce str_repeat()PHP funkce in_array()PHP funkce str_shuffle()PHP funkce log()PHP funkce restore_include_path()PHP funkce ucwords()PHP funkce forward_static_call_array()PHP funkce localeconv()PHP funkce call_user_method()PHP funkce trim()PHP funkce is_executable()PHP funkce connection_aborted()PHP funkce filectime()PHP funkce asinh()PHP funkce gethostname()PHP funkce ceil()PHP funkce addcslashes()PHP funkce php_sapi_name()PHP funkce join()PHP funkce imageaffinematrixget()PHP funkce substr_count()PHP funkce stream_socket_get_name()PHP funkce stream_get_line()PHP funkce ob_get_length()PHP funkce stream_context_get_options()PHP funkce feof()PHP funkce is_dir()PHP funkce phpcredits()PHP funkce ob_get_clean()PHP funkce dir()PHP funkce ob_list_handlers()PHP funkce stream_context_get_params()PHP funkce natsort()PHP funkce iptcembed()PHP funkce get_current_user()PHP funkce pclose()PHP funkce fileatime()PHP funkce getmxrr()PHP funkce long2ip()PHP funkce max()PHP funkce sort()PHP funkce ucfirst()PHP funkce number_format()PHP funkce chgrp()PHP funkce debug_zval_dump()PHP funkce ezmlm_hash()PHP funkce image_type_to_extension()PHP funkce substr_compare()PHP funkce uksort()PHP funkce serialize()PHP funkce stream_context_create()PHP funkce set_include_path()PHP funkce imagecrop()PHP funkce pow()PHP funkce lchgrp()PHP funkce get_headers()PHP funkce sha1()PHP funkce hypot()PHP funkce is_uploaded_file()PHP funkce filesize()PHP funkce filetype()PHP funkce rewinddir()PHP funkce getimagesizefromstring()PHP funkce ob_end_flush()PHP funkce pfsockopen()PHP funkce unregister_tick_function()PHP funkce similar_text()PHP funkce ob_implicit_flush()PHP funkce prev()PHP funkce register_shutdown_function()PHP funkce inet_ntop()PHP funkce gethostbynamel()PHP funkce stream_socket_shutdown()PHP funkce register_tick_function()PHP funkce gettimeofday()PHP funkce readdir()PHP funkce count_chars()PHP funkce lchown()PHP funkce fmod()PHP funkce strstr()PHP funkce rsort()PHP funkce tanh()PHP funkce quoted_printable_decode()PHP funkce is_link()PHP funkce get_resources()PHP funkce tan() - TangentPHP funkce filegroup()PHP funkce ignore_user_abort()PHP funkce range()PHP funkce socket_get_status()PHP funkce import_request_variables()PHP funkce crc32()PHP funkce stream_set_read_buffer()PHP funkce sqrt()PHP funkce strnatcasecmp()PHP funkce pi()PHP funkce stream_get_wrappers()PHP funkce end()PHP funkce call_user_func_array()PHP funkce chown()PHP funkce htmlentities()PHP funkce socket_import_stream()PHP funkce decbin()PHP funkce call_user_method_array()PHP funkce strspn()PHP funkce fgets()PHP funkce dl()PHP funkce floor()PHP funkce strripos()PHP funkce mail()PHP funkce dns_get_mx()PHP funkce set_socket_blocking()PHP funkce pack()PHP funkce fclose()PHP funkce headers_list()PHP funkce get_html_translation_table()PHP funkce headers_sent()PHP funkce setcookie()PHP funkce fileperms()PHP funkce fileowner()PHP funkce flush()PHP funkce call_user_func()PHP funkce fileinode()PHP funkce chunk_split()PHP funkce set_magic_quotes_runtime()PHP funkce stream_socket_recvfrom()PHP funkce cli_get_process_title()PHP funkce arsort()PHP funkce is_writeable()PHP funkce ob_end_clean()PHP funkce round()PHP funkce next()PHP funkce uniqid()PHP funkce intval()PHP funkce ob_get_level()PHP funkce stream_filter_append()PHP funkce ini_restore()PHP funkce gethostbyaddr()PHP funkce expm1()PHP funkce get_meta_tags()PHP funkce highlight_file()PHP funkce flock()PHP funkce rad2deg()PHP funkce get_include_path()PHP funkce parse_ini_file()PHP funkce get_magic_quotes_runtime()PHP funkce str_split()PHP funkce ob_clean()PHP funkce stream_select()PHP funkce ob_get_status()PHP funkce strnatcmp()PHP funkce closelog()PHP funkce rewind()PHP funkce convert_cyr_string()PHP funkce stream_register_wrapper()PHP funkce min()PHP funkce get_magic_quotes_gpc()PHP funkce natcasesort()PHP funkce touch()PHP funkce time_nanosleep()PHP funkce wordwrap()PHP funkce socket_set_blocking()PHP funkce pathinfo()PHP funkce floatval()PHP funkce strcoll()PHP funkce hebrev()PHP funkce ob_get_flush()PHP funkce sinh()PHP funkce html_entity_decode()PHP funkce sleep()PHP funkce closedir()PHP funkce stream_socket_client()PHP funkce realpath()PHP funkce time_sleep_until()PHP funkce print_r()PHP funkce is_nan()PHP funkce quoted_printable_encode()PHP funkce diskfreespace()PHP funkce strip_tags()PHP funkce md5()PHP funkce str_word_count()PHP funkce sin()PHP funkce stream_supports_lock()PHP funkce reset()PHP funkce is_writable()PHP funkce umask()PHP funkce bin2hex()PHP funkce stream_get_contents()PHP funkce var_dump()PHP funkce get_cfg_var()PHP funkce stat()PHP funkce php_ini_loaded_file()PHP funkce krsort()PHP funkce stripos()PHP funkce header_remove()PHP funkce iptcparse()PHP funkce fnmatch()PHP funkce dirname()PHP funkce stream_context_set_default()PHP funkce stream_filter_prepend()PHP funkce convert_uuencode()PHP funkce stream_socket_pair()PHP funkce forward_static_call()PHP funkce stream_context_set_option()PHP funkce stream_is_local()PHP funkce ksort()PHP funkce error_log()PHP funkce metaphone()PHP funkce inet_pton()PHP funkce ini_set()PHP funkce intdiv()PHP funkce error_get_last()PHP funkce log1p()PHP funkce getopt()PHP funkce glob()PHP funkce atanh()PHP funkce is_readable()PHP funkce php_strip_whitespace()PHP funkce zend_logo_guid()PHP funkce header_register_callback()PHP funkce quotemeta()PHP funkce htmlspecialchars_decode()PHP funkce fread()PHP funkce lstat()PHP funkce stripcslashes()PHP funkce ob_start()PHP funkce sys_getloadavg()PHP funkce extract()PHP funkce deg2rad()PHP funkce get_browser()PHP funkce key()PHP funkce image_type_to_mime_type()PHP funkce opendir()PHP funkce decoct()PHP funkce base64_encode()PHP funkce strpbrk()PHP funkce stream_socket_accept()PHP funkce stream_wrapper_unregister()PHP funkce imagecropauto()PHP funkce openlog()PHP funkce checkdnsrr()PHP funkce uasort()PHP funkce stripslashes()PHP funkce setrawcookie()PHP funkce lcfirst()PHP funkce base64_decode()PHP funkce rtrim()PHP funkce ini_get()PHP funkce money_format()PHP funkce filemtime()PHP funkce strtr()PHP funkce php_egg_logo_guid()PHP funkce php_real_logo_guid()PHP funkce fopen()AcoshEnd()
AI konzultace & implementace

Pomohu vám zavést AI do vašeho projektu – od analýzy a návrhu řešení až po nasazení do produkce. Ušetřete čas, zjednodušte procesy a získejte konkurenční výhodu.

Domluvit konzultaci
Konzultant: Jan Barášek
Potřebujete poradit s PHP?

Nabízím trénink vývojářů, konzultace, školení a analýzu návrhových vzorů. Osobně v Praze nebo online.

Napište mi
V jiných jazycích

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.