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 willing to do is this... if the phrase is:
log("Ola");
i want to take this part of ( Hello ) and send in that function down there to run the Cryptography, if I use the $1 outside the function, works normal, but when put in does not work
From now on, thank you
Utilize preg_replace_callback
– Valdeir Psr
Oops, I put this function and it didn’t work :/ the problem seems to be in the form that I inserted $1 in the second array, but I tried anyway :/
– SnowRunescape
@Valdeirpsr Are you unable to answer? I have noticed that you only comment.
– Sam
@dvd There are no problems (technical) in responding. Only one of the ways to respond them quickly (in some cases).
– Valdeir Psr
@Snowrunescape This would be https://ideone.com/vq7EzF ?
– Valdeir Psr
@Valdeirpsr Psr, It worked, thank you very much :)
– SnowRunescape