RE: [PHP-WIN] How to compare variable to string contains "$" ???
| From: | Jeroen ten Berge | Date: | Fri, 06 Oct 2000 13:56:05 +0000 |
| Subject: | RE: [PHP-WIN] How to compare variable to string contains "$" ??? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-3008@lists.php.net to get a copy of this message | ||
Oops, one ")" to much :)
I don't think you have to escape _'s...
-----Original Message-----
From: Asendorf, John [mailto:JAsendorf@lcounty.com]
Sent: vrijdag 6 oktober 2000 15:46
To: Mariusz Topczewski; Php-Windows (E-mail)
Subject: RE: [PHP-WIN] How to compare variable to string contains "$" ???
Give this a try:
<?PHP
//doublecheck the correct input
echo "here's the thing $table[$i][$j] ";
if (ereg ( "$IN\_UZ" , $table[$i][$j] )) {
echo "<br />works";
} else {
echo "<br />nope";
}
?>
---------------------
John Asendorf - jasendorf@lcounty.com
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
> -----Original Message-----
> From: Mariusz Topczewski [mailto:Mariusz.Topczewski@bianet.com.pl]
> Sent: Friday, October 06, 2000 8:47 AM
> To: Php-Windows (E-mail)
> Subject: Odp: [PHP-WIN] How to compare variable to string
> contains "$" ???
>
>
> if ($table[$i][$j] == "\$IN_UZ" ) doesn't work :-(
>
> Could you help me?
>
> Mariusz
>
> > Have you tried a preceding slash?
> >
> > if ($table[$i][$j] == "\$IN_UZ" )
> >
> > I'm not sure if it will work, but give it a try...
> >
> > you could also use a regex... if the first one doesn't
> work, let me know
> > and I'll put together one for you.
> >
> > John
> >
> > ---------------------
> > John Asendorf - jasendorf@lcounty.com
> > Web Applications Developer
> > http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> > Licking County, Ohio, USA
> > 740-349-3631
> >
> >
> > > -----Original Message-----
> > > From: Mariusz Topczewski [mailto:Mariusz.Topczewski@bianet.com.pl]
> > > Sent: Friday, October 06, 2000 7:52 AM
> > > To: php-windows@lists.php.net
> > > Subject: [PHP-WIN] How to compare variable to string
> contains "$" ???
> > >
> > >
> > > Hi,
> > >
> > > I would like check somthing like this:
> > >
> > > if ($table[$i][$j] == "$IN_UZ" ) $IN_UZ -> this is string
> > > contains char
> > > "$", not a variable
> > >
> > > Regards,
> > > Mariusz
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-windows-help@lists.php.net
> > > To contact the list administrators, e-mail:
> > > php-list-admin@lists.php.net
> > >
> >
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net