Posts

Showing posts with the label line-breaks

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 re...