Jump to content

base64_encode


jakebur01

Recommended Posts

Hello,

 

I have some code that I have to change '<?' to '<?php' for it to work. I have one part of the code that may be encoded base64_encode with the '<?' trapped inside. Is their a snippit of code I could insert to convert all of the code from '<?' to '<?php'? How do I fix this?

 

Thanks,

 

Jake

Link to comment
https://forums.phpfreaks.com/topic/44924-base64_encode/
Share on other sites

str_replace('<?','<?php',$string);

perhaps? I don't really see what base64 encoding has to do with changing <? to <?php...

 

Just in case you have the string '<?' somewhere in your page that isn't actually a PHP tag, you could look to make sure that you have whitespace following the '<?' with a regexp lookahead:

<?php
$string = preg_replace('|\<\?(?=\s)|', '<?php', $string);
?>

Link to comment
https://forums.phpfreaks.com/topic/44924-base64_encode/#findComment-218180
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.