PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Here's something for you l33t programmers to laugh at.
I just started with PHP a month or so ago. I wanted to start programming, so I started with PHP because I'd heard it was easy and combines style from many other languages. Anyways, I was trying to make a basic calculator-type program to test my skills, but I keep getting the "unexpected T_ELSE on line 17". I really hope there isn't an embarassing number of errors as I think... Here's the code:
1. use a closing bracket "}"instead of an openning one "{" before your else part. Here's a modified code for you:
2. change the type of your variables. $a and $b are string... you can't assign $c to have an integer value (coz $c = $a - $b .. wherein both $a and $b are strings)
3. In your last print statement, notice that you have to close off the quotes when you're going to concatenate.