php - Strip tags (< and >) -
I & amp; Lt; and
& gt; ; and all of them in PHP save it in one variable.
Example:
From:
& amp; Amp; Lt; P & gt; This is a paragraph & amp; Amp; Lt; Strong & amp; ; Gt; Bold & amp; Lt; / Strong & amp; Gt; Text & amp; Lt; / P & gt;
To do this:
This is a paragraph with bold text
Have also got an example or idea? Thanks!
If you have nested & amp; Gt; Not and & amp; Lt; , then you can try the following to match occurences:
$ matches = array (); Preg_match_all ('/ amp; lift; ([\ s \ S] *?) & Amp; gt; / s', $ string, $ matches); Try the code for your stroke in ? Pay attention to which makes unbelievable matches in the grave, you can find the answer to a similar question.
If you want to delete values, use preg_replace_callback :
Comments
Post a Comment