Re: find string
| From: | David Nicholson | Date: | Sun, 10 Aug 2003 23:33:10 +0000 |
| Subject: | Re: find string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159074@lists.php.net to get a copy of this message | ||
Hello,
This is a reply to an e-mail that you wrote on Mon, 11 Aug 2003 at
00:25, lines prefixed by '>' were originally written by you.
> Isn't there an in_array function you can use?
> If (in_array($action, array(a1,a2,a3,a4)) {
> // do something
> else {
> // do something else
> Carl.
Make sure that your string values are in quotes or PHP will belooking
for constants with those names, i.e.
array('a1','a2','a3','a4')
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Free PHP error handling script: www.phpmachine.com/error-handler/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/