src/MalScraper/Helper/Helper.php
public static function response($response)
    {
        $result = [];
        if (is_numeric($response)) {
            header('HTTP/1.1 '.$response);
            $result['status'] = $response;
            $result['status_message'] = self::toResponse($response);
            $result['data'] = [];
        } else {
            header('HTTP/1.1 '. 200);
            $result['status'] = 200;
            $result['status_message'] = 'Success';
            $result['data'] = self::superEncode($response);
        }

        $json_response = json_encode($result, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
        $json_response = str_replace('\\\\', '', $json_response);

        return $json_response;
    }
public static function response($response)
    {
        $result = [];
        if (is_numeric($response)) {
            header('HTTP/1.1 '.$response);
            $result['status'] = $response;
            $result['status_message'] = self::toResponse($response);
            $result['data'] = [];
        } else {
            header('HTTP/1.1 '. 200);
            $result['status'] = 200;
            $result['status_message'] = 'Success';
            $result['data'] = self::superEncode($response);
        }

        $json_response = json_encode($result, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
        $json_response = str_replace('\\\\', '', $json_response);

        return $json_response;
    }
public static function response ( $ response ) { $ result = [ ] ; if ( is_numeric ( $ response ) ) { header ( 'HTTP/1.1 ' . $ response ) ; $ result [ 'status' ] = $ response ; $ result [ 'status_message' ] = self :: toResponse ( $ response ) ; $ result [ 'data' ] = [ ] ; } else { header ( 'HTTP/1.1 ' . 200 ) ; $ result [ 'status' ] = 200 ; $ result [ 'status_message' ] = 'Success' ; $ result [ 'data' ] = self :: superEncode ( $ response ) ; } $ json_response = json_encode ( $ result , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT ) ; $ json_response = str_replace ( '\\\\' , '' , $ json_response ) ; return $ json_response ; }
Convert return result into http response.

@param string|array $response

@return string
Convert return result into http response .