By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,721 Members | 1,468 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,721 IT Pros & Developers. It's quick & easy.

Include <? ?> in string literal

P: n/a
I want to programmatically 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.
Jan 25 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.