Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $tag_to_add = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
- $file = 'file.xml';
- // Using file_put_contents()
- $myfile = file_put_contents($file, $tag_to_add.PHP_EOL , FILE_APPEND | LOCK_EX);
- // Using fwrite()
- $fstream = fopen($file, 'a');
- fwrite($fstream, '\n'. $tag_to_add);
- fclose($fstream);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement