Current Location: Home> Function Categories> realpath_cache_get

realpath_cache_get

Get realpath cache entry
Name:realpath_cache_get
Category:File system
Programming Language:php
One-line Description:Get the current realpath cache list

Function name: realpath_cache_get()

Applicable version: PHP 5 >= 5.3.2, PHP 7

Function description: The realpath_cache_get() function is used to get the current realpath cache list.

usage:

realpath_cache_get(void): array|false

Parameters: No parameters

Return value: If the realpath cache list is successfully obtained, a related array containing cache information is returned. If no cache information is available, false is returned.

Example:

 // 获取realpath 缓存列表$cacheList = realpath_cache_get(); if ($cacheList !== false) { foreach ($cacheList as $path => $realpath) { echo "路径: " . $path . " => 真实路径: " . $realpath . "<br>"; } } else { echo "无realpath 缓存信息可用。"; }

Notes:

  1. The realpath_cache_get() function returns valid results only when the realpath cache is available. If the realpath cache is not enabled or empty, the function returns false.
  2. The realpath_cache_get() function performs better in PHP 7 and subsequent versions, because the realpath cache has been improved to use LRU (most recently used) algorithms.
  3. The result of the realpath_cache_get() function is an associative array where the key is the path and the value is the real path to that path. All cached realpath information can be accessed and processed by traversing the array.
Similar Functions
  • Returns the normalized absolute path name realpath

    realpath

    Returnsthenormalized
  • Test whether the file pointer reaches the end of the file feof

    feof

    Testwhetherthefilepo
  • Determine whether the file is uploaded through HTTP POST is_uploaded_file

    is_uploaded_file

    Determinewhetherthef
  • Get file information through the opened file pointer fstat

    fstat

    Getfileinformationth
  • Determine whether the given file name is a normal file is_file

    is_file

    Determinewhethertheg
  • See unlink() or unset() (PHP does not have delete keywords or functions) delete

    delete

    Seeunlink()orunset()
  • Provide information about the document stat

    stat

    Provideinformationab
  • Determine whether the file exists and is readable is_readable

    is_readable

    Determinewhetherthef
Popular Articles