I want to edit values in a array php file.
this is lang.php
$lang = array (
'l_name' => "Language",
'b' => "Break");
I want to replace 'l_name' => "Language",
into 'l_name' => "Hi its me.",
how I can do it?
$fileContents = file_get_contents($path_to_file);
$search = array('l_name');
$replace = array('Hi, its me');
$newContents = str_replace($search, $replace, $fileContents);
$handle = fopen($path_to_file ,"w");
fwrite($handle, $newContents);
fclose($handle);
I tried this but its not working its replacing the key 'l_name'
I want to replace to value of key, How can i do it?
Thanks in advance.