killah Posted February 18, 2009 Share Posted February 18, 2009 I was wondering is there anyway i can change the word "crystals" to "diamonds" either using a php file or by using .htaccess? I know there is a way with a SSH command, but i do not have SSH access. Link to comment https://forums.phpfreaks.com/topic/145715-change-word-through-out-100-files-with-php/ Share on other sites More sharing options...
cola Posted February 18, 2009 Share Posted February 18, 2009 Yes here is way $content = @file_get_contents("file.php"); $word= str_replace ('crystals','diamonds',$content); echo $word; Link to comment https://forums.phpfreaks.com/topic/145715-change-word-through-out-100-files-with-php/#findComment-765057 Share on other sites More sharing options...
trq Posted February 18, 2009 Share Posted February 18, 2009 .htaccess is a apache configuration file. It can't do anything of the sort. ssh is a protocol used to connect to a remote shell instance, it can't do anything of the sort either. php probably isn't the best solution to this problem, find & sed on the other hand are. You should be able to execute shell commands via php's shell_exec function. find . -type f -exec sed -i -e 's/crystals/diamonds/g' {} \; Link to comment https://forums.phpfreaks.com/topic/145715-change-word-through-out-100-files-with-php/#findComment-765059 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.