<?php
// string to search in a filename.
$searchString = 'i';
// all files in my/dir with the extension
// .php
$files = glob('*.php');
// array populated with files found
// containing the search string.
$filesFound = array();
// iterate through the files and determine
// if the filename contains the search string.
foreach($files as $file) {
$name = pathinfo($file, PATHINFO_FILENAME);
// determines if the search string is in the filename.
if(strpos(strtolower($name), strtolower($searchString))) {
$filesFound[] = $file;
}
}
// output the results.
print_r($filesFound);
?>หาคำใน ไฟล์ php
https://stackoverflow.com/questions/3686177/php-to-search-within-txt-file-and-echo-the-whole-line
ค้นหาและแทนที่ ใน DB
https://github.com/interconnectit/Search-Replace-DB https://github.com/inpsyde/search-and-replace https://github.com/wp-cli/search-replace-command
ค้นหา และ แทนที่ใน file
https://github.com/mtjo62/PHP-Search-and-Replace
ค้นหา และ แทนที่ใน Directory
https://github.com/andmed/find-and-replace-php