There is plugin for Vim, developed by the infamous scrooloose, called Syntastic that does exactly what you are looking for. It is described as:
A syntax checking plugin
that runs buffers through external
syntax checkers as they are saved and
opened. If syntax errors are detected,
the user is notified and is happy
because they didn't have to compile
their code or execute their script to
find them.
The syntax checker is extended with language plugins and there just so happens to be one for PHP as well as HTML, although I'm not positive about CSS at the moment. Either way, as soon as you open a file or attempt to save one that has syntax errors, you can set up Syntastic to alert you in various ways:
* A statusline flag appears when syntax errors are detected
* |signs| are placed beside lines with syntax errors, where a different
sign is used for errors and warnings.
* The :Errors command is provided to open a |location-list| for
the syntax errors in the current buffer
Be sure to check out the helpdoc as there is a ton of useful info in there.
https://github.com/scrooloose/syntastic