public static function sendResponse(ResponseInterface $response) 
    {
		$code = $response->getStatusCode();
		$reason = $response->getReasonPhrase();
		header(
			sprintf('HTTP/%s %s %s', $response->getProtocolVersion(), $code, $reason),
			true, $code 
		);

		foreach ($response->getHeaders() as $header => $values) {
			foreach ($values as $value) {
				header("$header: $value", false);
			}
		}

		echo $response->getBody();
	}
public static function sendResponse(ResponseInterface $response) 
    {
		$code = $response->getStatusCode();
		$reason = $response->getReasonPhrase();
		header(
			sprintf('HTTP/%s %s %s', $response->getProtocolVersion(), $code, $reason),
			true, $code 
		);

		foreach ($response->getHeaders() as $header => $values) {
			foreach ($values as $value) {
				header("$header: $value", false);
			}
		}

		echo $response->getBody();
	}
public static function sendResponse ( ResponseInterface $ response ) { $ code = $ response -> getStatusCode ( ) ; $ reason = $ response -> getReasonPhrase ( ) ; header ( sprintf ( 'HTTP/%s %s %s' , $ response -> getProtocolVersion ( ) , $ code , $ reason ) , true , $ code ) ; foreach ( $ response -> getHeaders ( ) as $ header => $ values ) { foreach ( $ values as $ value ) { header ( "$header: $value" , false ) ; } } echo $ response -> getBody ( ) ; }
Utility function to emit a Response without additional framework.
Utility function to emit a Response without additional framework .