我怎么能用echo或header重定向php中的页面?(在if条件下)

Ok, I tried echo and header to redirect my page when the password is correct but the page isn't redirecting. I tried several time but nothing is happening

i am using xammp and php7 for this site.

if($stmt->rowCount() > 0){
    // get retrieved row
    $row = $stmt->fetch(PDO::FETCH_ASSOC);
    // create array
    $user_arr=array(
        "status" => true,
        "message" => "Successfully Login!",
header( 'Location: ./index.html' ),
        "id" => $row['id'],
        "username" => $row['username']

    );

in phpstorm when i am using header( 'Location: ./index.html' ), it telling me that i am using void.

The issue is a broken array.

<?php
    if($stmt->rowCount() > 0){
        // get retrieved row
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
        // create array
        $user_arr=array(
            "status" => true,
            "message" => "Successfully Login!",
            "id" => $row['id'],
            "username" => $row['username']
        );
        // Moved out of $user_arr
        header( 'Location: ./index.html' );
        exit;
    }
?>