Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $filename = "path/file.php";
- $code_add = file_get_contents(__DIR__."/views/code.php");
- $string_to_replace = "<?php if(get_option('allow_registration') == 1) { ?>";
- $replace_with = "<?php if(get_option('allow_registration') == 1) { ?>\n".$code_add;
- $content = file_get_contents($filename);
- $content_chunks = explode($string_to_replace, $content);
- $content = implode($replace_with, $content_chunks);
- file_put_contents($filename, $content);
- $css_add = "end of the line add";
- file_put_contents($filename, $css_add . PHP_EOL, FILE_APPEND);
- ?>
Add Comment
Please, Sign In to add comment