strip_tags() .... replace tags by space rather than deleting them
php
Solution
Try this.
preg_replace('#<[^>]+>#', ' ', '<h1>Foo</h1>bar');
Problem
Do you know how to replace html tags with a space character using php? If I display ``` strip_tags('<h1>Foo</h1>bar'); ``` I get as result "foobar" but what I need to keep words separate is "foo bar".