I
I
Ivan Yakushenko2019-04-19 08:34:59
Visual Studio Code
Ivan Yakushenko, 2019-04-19 08:34:59

How to make multiple change of values ​​in php files?

There are several dozen *.php files containing the following data:

$_['value_blank']			= 'New Window';
$_['value_self']			= 'Same Window';
$_['value_name']       		= 'Name';
$_['value_model']       	= 'Model';
........

All of them have both the same template elements and unique elements for each file.
I need to change the values ​​in all files, i.e. only the "New Window" lines, etc. Is there any way to do this in one fell swoop?
P.S. I use Visual Studio Code

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
irishmann, 2019-04-19
@kshnkvn

Open all files, for example, in Notepad ++, select what needs to be replaced, select the replacement tool on the panel, enter what we want to change to, press the replace button in all open ones.
It will work provided that the search string is written in the same way in all files.

S
Stalker_RED, 2019-04-19
@Stalker_RED

cd /path/to/your/folder
sed -i 's/foo/bar/g' *
instead of foo there can be a regular expression

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question