Save linebreaks in textarea to tpl file with php


Save linebreaks in textarea to tpl file with php



I want to edit html code in a textarea and then save it to a tpl-file.



When opening the template file with my desktop editor the linebreaks should just look like in the textarea, so no n or br-tag (if not actually wanted for the code) in it.



Thanks for any help!





Ah, changing from tpl to txt when googeling did the trick. $code = str_replace('n', PHP_EOL, $code);
– user2822542
Jul 1 at 10:51






What do you mean by "changing from tpl to txt"?
– Nico Haase
Jul 1 at 11:05









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

List of Kim Possible characters

Audio Livestreaming with Python & Flask

NSwag: Generate C# Client from multiple Versions of an API