Ask a question about the if statement in a function. if a Cainiao has similar functions, it is incomplete. just give an example of function & nbsp; p_abc ($ a, $ B, $ c) {& nbsp; $ a & nbsp; xxx & nbsp; if & nbsp; ($ b255) {& ask a question about the if statement in a function. I am a newbie.
If there are similar functions that are incomplete, just give an example.
Function p_abc ($ a = '', $ B ='', $ c = ''){
$ A = xxx
If ($ B = '000000 '){
$ A = xxx + 1
}
$ C = yyy
}
When $ B = '000000', the function can run normally. when $ B is not equal to 255, it seems that $ c = yyy cannot be executed (I'm not sure ). Cause program errors.
Why? I am a newbie, please tell me.
Share: More
------ Solution --------------------
One = is a value assignment.
Two = is a comparison
Your if ($ B = '000000') {is to make $ B 255, and the expression will always be true.
Should Write if ($ B = '000000 '){