Why don't you just try:
$cust2 = str_replace('#','#',$cust);
That should replace all instances of # with it's html entity equivalent. If
that doesn�t work then there is something else wrong with your script and
we'll need to see it all! :)
Rick
"People who drink to drown their sorrow should be told that sorrow knows how
to swim." - Ann Landers
> 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.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php