I know you can use fopen and stuff. But I am making a php file to edit another php file that would be a config file. Such as $logo = 'img url'; have php read and edit img url to lets say a real image url? How would I go about doing this?
Using fopen and stuff, you can read in the line and then run an str_replace() on it. That should do it
you could use something like this (untested): $source = file_get_contents('source.php'); $source = preg_replace('\$logo = \'[^\']*\';', '$logo = \'new url\';', $source); file_put_contents('source.php', $source); PHP: