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!
Try it and see? The 2nd one will give you a syntax error.
I know it gives me a syntax eror, im trying to figure out witch one the server out puts if it did show the php code and HTML. but i am thinking the first one also, thanks a bunch
The first one is correct because you jump in and out of PHP in the correct sequence.
The second one you never end your PHP block - you cannot have HTML embedded into your PHP in that manner without either echoing/printing it in some way. Anything between the <? ?> tags must be valid PHP code and "</div>" isn't, for example. Hope that makes more sense.