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
  • Determine whether the given file name is a symbolic connection is_link

    is_link

    Determinewhethertheg
  • Open a file or URL fopen

    fopen

    OpenafileorURL
  • Write to files (safely used in binary files) fwrite

    fwrite

    Writetofiles(safelyu
  • Read a line from the file pointer and parse the CSV field fgetcsv

    fgetcsv

    Readalinefromthefile
  • Read the entire file into an array file

    file

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

    feof

    Testwhetherthefilepo
  • Return the target of the symbolic link readlink

    readlink

    Returnthetargetofthe
  • Format input from a file fscanf

    fscanf

    Formatinputfromafile
Popular Articles