Php

natsuki

New Member
Messages
112
Reaction score
0
Points
0
$_POST['val1'] and $_POST['val2'] could possibly be "0" so if (trim($_POST['val1']) == '') checks if there's really nothing in it. The switch() version is clearer though.

There's actually a code styling rule that says "every bracket should be on a line of its own. usually if without brackets is not good. use as many white spaces for the sake of readability"

but that's just one coding rule among many, and it usually is applicable for code that is shared or commonly edited by other people

I'm currently having a terrible bug in my prog (C++) something memory not writable, it keeps crashing at the last part when you actually exit the prog o_O
 
Last edited:
Top