substitute string in php from another file

Posted by Gjergj Sheldija on Stack Overflow See other posts from Stack Overflow or by Gjergj Sheldija
Published on 2010-05-03T11:15:27Z Indexed on 2010/05/03 11:18 UTC
Read the original article Hit count: 171

Filed under:
|
|
|

i have some old php files which i'd like to convert to use gettext. those files have a content like this :

$LD = 'Some String';
$Another = 'some other ~n~ string';

i have to substitute all the $LD, $Another in the files where they are declared with something like :

_('Some string');

hacking a bit a created some sort of regexp to find the declarations, my aim was to use sed and awk to do the replaces..but i don't have any clue on how to do those substitutions ...

any help ...

© Stack Overflow or respective owner

Related posts about php

Related posts about sed