Use PHP’s header function to send the code (along with the HTTP version and any other headers you need). More complete info:
When to send HTTP status code?
http://php.net/manual/en/function.header.php
http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 300');//300 seconds