PHP is a proof that you don't need elegant or good technical solutions to be successful. You can literally pile up slop together and still be successful.
PHP might seem worse than other languages due to a combination of factors:
- It's the most used one by far, even though few of us like to admit it.
- Old tutorials still come up during web searches, so "SELECT * FROM `table` WHERE id = $id" will still be written today.
ASP had a bit of a barrier to entry because it required all the MS. Whereas PHP was everywhere.