Click to See Complete Forum and Search --> : search files in shared hosting
nuttynibbles
12-15-2008, 04:14 PM
hi, im using shared hosting. so right now i wanna make some text changes and i need to open each file to check if it exists and do a search and replace. i understand in putty, we can do a search and identify which files have the text. because it's a shared host, i do not have access to putty. is there an alternative way??
bradgrafelman
12-18-2008, 02:37 AM
You could always make a PHP script to accomplish the same task. Have it glob() a directory of files (possibly specifying an extension, if you know it, e.g. "*.txt"), loop over the results and if it's a directory (is_dir()) then run the same function on that directory (e.g. a recursive search), else read the file in (file_get_contents(), for example) and search.
PHP Builder
Copyright Internet.com Inc. All Rights Reserved.