Syntax is really important. Syntax is really, really, important. If you are new to programming, I cannot stress this enough: Syntax is really, really, really important. How important is it? Without proper syntax, your program isn't even a program at all. It's
that important.
What is syntax? In both programming and linguistics definitions, syntax refers to the rules and principles for constructing sentences or statements in a language. What does this mean for you? Programming is very precise. One invalid keystroke anywhere in your code could result in the entire program breaking. Remember, computers aren't like humans; they don't read the code like humans might read it. Computers process your code by parsing it, or breaking it down into the rules of a language. If your code is not properly formed, the computer won't be able to break it down and figure out what you want it to do.
You must also ensure that you follow the syntax of the language in which you are programming. Code written in PHP may look entirely different in another language since each language has different rules and is parsed differently. It is for this reason that you need to be very accurate in your programming. Even if code is syntactically correct, if you don't follow the rules of the language, the code may do something you do not expect.
As a new programmer, one of the most time-consuming processes you will face is going through your code to find the one minor symbol you may have forgotten or by finding that extra character that wasn't supposed to be in the code at all. Over time you will train your eye to spot these errors, but until you reach that point, you must be extra careful when copying code or writing new code yourself.