Jump to content

preg_replace trouble


newbtophp

Recommended Posts

Hmm im having abit of trouble, how would i replace:

 

;echo '
';

(contains a new line after opening quote).

 

with:

 

?>
<?php

 

 

Example:

 

<?php
include("../config.php");
;echo '
';
$variable = "test";
echo $variable;
?>

 

Would turn into:

 

<?php
include("../config.php");
?>
<?php
$variable = "test";
echo $variable;
?>

 

:-\

Link to comment
https://forums.phpfreaks.com/topic/184425-preg_replace-trouble/
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.