Re: eregi_replace()
| From: | John Taylor-Johnston | Date: | Fri, 09 Jul 2004 20:07:45 +0000 |
| Subject: | Re: eregi_replace() | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190099@lists.php.net to get a copy of this message | ||
>if (strtoupper($searchenquiry) == strtoupper($mydata->JR) )
The problem is $searchenquiry would be contained inside $mydata->JR so I would need to see if it
exists and then put <b>...</b> around it, without changing the original case.
Thanks,
J
"Matt M." wrote:
> > $mydata->JR = eregi_replace($searchenquiry,
> > "<b>".$searchenquiry."</b>", $mydata->JR);
> > echo $searchenquiry;
> >
> > What I should display is if $searchenquiry = $mydata->JR in a case insensitive way then
> > echo "<b>".$searchenquiry."</b>";
> >
> > Do I use if (x =~ b) {} or some sort of string compare or ... ?
> > John
>
> if you want to compare the 2 strings why not do something like this:
>
> if (strtoupper($searchenquiry) == strtoupper($mydata->JR) )