Re: &
| From: | Tom | Date: | Wed, 28 Jan 2004 15:16:40 +0000 |
| Subject: | Re: & | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-176058@lists.php.net to get a copy of this message | ||
Gerard Samuel wrote:
On Wednesday 28 January 2004 09:32 am, Stuart wrote:Diana Castillo wrote:Just a heads up on using the above method. If there are more than one & in the string it will produce unexpected results.is there any function that will always replace a "&" with a "&" in a string?$string = str_replace('&', ' ', $string);
For example "Here is one & and here is another &" will produce "Here is one & and here is another &"You could use preg_replace( '/&(?!amp;)/', '&', $string); But I suspect that the OP is probably looking for "htmlentities" and other such built in PHP functions.