They are both correct. Personally I prefer your approach better for its verbosity but it's really down to personal preference.
Off hand, running if($_POST) would not throw an error - the $_POST array exists regardless if the request was sent with POST headers. An empty array is cast to false in a boolean check.