By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,045 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,045 IT Pros & Developers. It's quick & easy.

Syntax error??

P: n/a
Why does the following line create a Syntax error in PHP.

$Mac = ( (strstr($query,'Mac') || (strstr($query,'Mc') ||
(strstr($query,'M ') );

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 28/03/2005 18:53, Evan wrote:
Why does the following line create a Syntax error in PHP.
The statement (it's two lines :P) has unmatched closing parentheses.
$Mac = ( (strstr($query,'Mac') || (strstr($query,'Mc') ^ ^ ^ ^ ^ ^ ^
1 2 3 2 3 4 3
|| (strstr($query,'M ') );

^ ^ ^ ^
4 5 4 3

The digits show the number of open parentheses. As you can see, you're
left with three by the end of the statement. I imagine that the
opening parenthesis before each strstr function call shouldn't be there.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 17 '05 #2

P: n/a

Thanks! Sure makes you feel dumb when you make a stupid mistake like
that and then can't spot what is wrong!

Evan

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.