Simple questions in php

Source: Internet
Author: User
In php, what are the common errors in the if (a = B) {c = 10; d = 100} statements ?, For php condition statements, either & nbsp ;=/// & nbsp; if & nbsp; ($ a & nbsp ;=& nbsp ;$ B) or & nbsp; ===& nbsp; & nbsp; if & nbsp; ($ a & nbsp ;==& nbsp; $ B) simple php problems
In the statement if (a = B) {c = 10; d = 100}, what are the errors?
------ Solution --------------------
Php condition statement
Either = // if ($ a = $ B)
Either === if ($ a ===$ B)

D = 100 followed by no semicolon

Add $
------ Solution --------------------
The logical judgment should use the equal sign =. in js, you do not need to add extra points at last. php must add $ and.
------ Solution --------------------
Four ~
// 1 $ a $ B $ c $ d
// 2 $ a = $ B
// 3 $ d = 100;
// 4. code format problems.

------ Solution --------------------
Reference:
Four ~
// 1 $ a $ B $ c $ d
// 2 $ a = $ B
// 3 $ d = 100;
// 4. code format problems.

There is no error in the second syntax.
Are there any errors, depending on the requirements?
------ Solution --------------------
1. neither a nor B is defined.
2 variable to use $
3. PHP compares two equal signs.
4 $ d = 100 missing a semicolon
------ Solution --------------------
1. Add $.
2. $ d = plus points after 100.
Otherwise, no error is reported.




------ Solution --------------------
I haven't seen each other for a long time. I answered this question according to the 2b logic of this person ~ Of course, there is no error in pure syntax in single value assignment.
Reference:
Reference: Four ~
// 1 $ a $ B $ c $ d
// 2 $ a = $ B
// 3 $ d = 100;
// 4. code format problems.
There is no error in the second syntax.
Are there any errors, depending on the requirements?

------ Solution --------------------
1. $ a, $ B, $ c, $ d,
Plus points after 2.100;
3. $ a = $ B, which is correct ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.