I'm using below line to remove text formatting from ckeditor result text area for some reasons.
html_entity_decode(strip_tags($result_string_from_ckeditor),ENT_QUOTES,'utf8');
It works great except than it stripping new lines and all separate lines will be join to each other.
I tried solution in this post and used below line, but no success
html_entity_decode(strip_tags(nl2br($result_string_from_ckeditor),'<br>'),ENT_QUOTES,'utf8');
Edit: for example
ckeditor source text:
<p>This is an example</p>
<p>of problem in strip_tags</p>
Source result after using command:
<p>This is an exampleof problem in strip_tags</p>
Many thanks.