Get the $ 1 preg_replace value inside an array that has an execution of a function inside

0

Well, I want to change a text from one sentence to another (it's like an encryption)

code being used:

$dd = array();

$UserInfo = new UserInfo;

$search = array(
    '/log\((.*)\);/'
);

$replace = array(
    'log("' . $UserInfo->encrypt_text('$1', $dd) . '");'
);

$buffer = preg_replace($search, $replace, $buffer);

What I'm trying to do is the following ... if the phrase is:

log("Ola");

I want to get this part of the (Ola) and send that function down there to run the Encryption, if I use the $ 1 out of the function, it works normal, but when put in it does not work

From now, thank you

    
asked by anonymous 03.06.2018 / 02:54

0 answers