Escaping '#' Sign
| From: | Mike Smith | Date: | Wed, 11 Dec 2002 23:45:18 +0000 |
| Subject: | Escaping '#' Sign | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-127926@lists.php.net to get a copy of this message | ||
I have a string I'm returning from a database. Some entries have # signs in the names ie (COMPANY #42, COMPANY #43...). When I display results all I have is COMPANY. Everything after the # is dropped off. I tried:
If ($cust) {
$cust2=ereg_replace('#','no',$cust);
//tried $cust2=ereg_replace("#","no",$cust); too
}
but that still returns the same thing (COMPANY).
Also tried:
$cust2 = preg_replace ("'&(pound|#163);'i", chr(163), $cust);
Any help is appreciated.