Basically, I am trying to check for a variable name in a script, and then I find that variable name, replace the entire line it resides on.
Example.php
Code: Select all
<?php
$my_search_file = 'some dynamic value';
$my_second_search_file = 'another dynamic value';
?>Code: Select all
<?php
$open_me = file_get_contents($Example.php);
$found_one = substr_count($open_me,'\$my_search_file');
//need code to replace the line here
?>