Include <? ?> in string literal

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul E Collins

    Include <? ?> in string literal

    I want to programmaticall y remove any <?...?section occurring on a
    single line. However, my regular expression needs to contain ?and
    that causes the interpreter to choke with a parse error. What's the
    standard way to include ?in a string?

    My current (failing) attempt is:

    $line = preg_replace('/<\?.*?\?>/', '', $line);

    Eq.


Working...