I have a problem that I could not solve on my own: replace ...
locale("Sendx", "Send")
locale("System", "System")
should become:
locale("Sendx", "Subsub")
locale("System", "Newsys")
I tried a simple replacement:
$mysearchword = "System";
$myreplaceword = "Newsys";
$oneline = str_replace($mysearchword, $myreplaceword, $oneline);
but the result looks like
locale("Sendx", "53ND")
locale("Newsys", "Newsys")
Of course, the system was replaced by both times. So I decided to use preg_replace
$pattern = '/locale\\(["|\']([^"\']*)["|\'], ["|\']([^"\']*)["|\']\\)/';
$replacement = '${1}, Newsys';
$subject = 'locale("System", "System")';
echo preg_replace($pattern, $replacement, $subject, -1 );
But now almost nothing is missing, because only the words in brackets are returned, and I have no idea how to include the template or return the replaced $ subject object. The $ template was changed, so I could not write "locale (..." in $ replacement / I, somehow I should return the replaced template ...
System, Newsys
Could you help me get the right result?