Re: Regular Expression help need

From: Date: Fri, 25 Jul 2008 19:30:53 +0000
Subject: Re: Regular Expression help need
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-277337@lists.php.net to get a copy of this message
Are you trying to make it xml compatible or XHTML compatible? '&' is not valid HTML or XHTML as it has special meaning. If you want it to adhere to the standard and display correctly, you must use '&amp;' Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Shelley wrote: > Hi Richard, > > Not exactly actually. > > What I mean is: > Before: <p>hi <strong>Richard</strong>>, & good > morning&lt;</p> > After: <p>hi <strong>Richard</strong>&gt;, &amp; good > morning&lt;</p> > > I hope it's clear now. > > On Fri, Jul 25, 2008 at 7:53 PM, Richard Heyes <richard.heyes@gmail.com> > wrote: > > >>> How can I make a string with & (NOT &amp;, &gt;, &lt; or &quot;), >>> <, > >>> >> xml >> >>> compatible? >>> What is the expression to use? >>> >> Not entirely sure what you're after (try posting some before and after >> snippets), but by the sounds of it you don't need a regular expression >> - strtr() will work for you. Or str_replace(). >> >> -- >> Richard Heyes >> http://www.phpguru.org >> >> > > > >

« previous php.general (#277337) next »