\n"; echo "\n"; echo "\n"; } // Open directory, fall back to English, // if there is no dir for that language $dirh = @opendir($_SERVER['DOCUMENT_ROOT'] . "/manual/$LANG"); if (!$dirh) { error_noservice(); } $functions = $maybe = $temp = $parts = []; $p = 0; // Get all file names from the directory while (($entry = readdir($dirh)) !== false) { // Skip names starting with a dot if (substr($entry, 0, 1) == ".") { continue; } // For function and class pages, get the name out if (preg_match('!^(function|class)\.(.+)\.php$!', $entry, $parts)) { $funcname = str_replace('-', '_', $parts[2]); $functions[$entry] = $funcname; // Compute similarity of the name to the requested one if (function_exists('similar_text') && !empty($notfound)) { similar_text($funcname, $notfound, $p); // If $notfound is a substring of $funcname then overwrite the score // similar_text() gave it. if ($p < 70 && ($pos = strpos($funcname, $notfound)) !== false) { $p = 90 - $pos; } $temp[$entry] = $p; } } } closedir($dirh); // We have found file names if (count($temp) > 0) { // Sort names by percentage arsort($temp); // Collect SHOW_CLOSE number of names from the top foreach ($temp as $file => $p) { // Stop, if we found enough matches if (count($maybe) >= 30) { break; } // If the two are more then 70% similar or $notfound is a substring // of $funcname, then the match is a very similar one if ($p >= 70 || (strpos($functions[$file], $notfound) !== false)) { $maybe[$file] = '' . $functions[$file] . ''; } // Otherwise it is just similar else { $maybe[$file] = $functions[$file]; } } unset($matches, $temp); } // Do not index page if presented as a search result if (count($maybe) > 0) { $head_options = ["noindex"]; } else { $head_options = []; } site_header("Manual Quick Reference", $head_options + ["current" => "help"]); // Note: $notfound is defined (with htmlspecialchars) inside manual-lookup.php $notfound_enc = urlencode($notfound); if ($snippet = is_known_snippet($notfound)) { echo "

Related snippet found for '{$notfound}'

"; echo "

{$snippet}

"; } ?>

PHP Function List

0) { ?>

doesn't exist. Closest matches:

'

Full website search', ]); }