Calliphoridae (pkbarbiedoll) wrote in php,
Calliphoridae
pkbarbiedoll
php

Parsing stray greater/less than symbols in HTML

$str = "

This is a test. This test is > that test, but is less than < the other test. The previous test may be

[Error: Irreparable invalid markup ('<the [...] test,>') in entry. Owner must fix manually. Raw contents below.]

<pre>$str = "<p>This is a test. This test is > that test, but is less than < the other test. The previous test may be <the second test, but is likely> than the third test. The fourth test may be < the first, but > than the last. This is the end of the test string.</p>";</pre>

Need to identify and convert the legit, non HTML greater/less than signs to ASCII.. I'm running out of ideas, especially with the substrings:

<pre>The previous test may be < the second test, but is likely > than the third test.</pre> and <pre>The fourth test may be < the first, but > than the last.</pre>

Anyone have a suggestion or hint on how to accomplish this?
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

  • 2 comments