Solved

IF statements

Posted on 2000-03-15
2
218 Views
Last Modified: 2008-03-06
Why does the following statement act as if the "IF" wasn't there?
if ($variable = "x y") {variable2 = 10;}

??? It assumes I mean:
variable2 = 10;

*confused*

Cheers,
Dave
0
Comment
Question by:dht1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
mrvithan earned 50 total points
ID: 2622235
Well... 'cause you use wrong condition... for logic, you have to use '==' instend. That at mean ... if($variable == "x y") {$variable2 = 10}
0
 

Author Comment

by:dht1
ID: 2623207
Doh!  Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question