为什么cURL会在最后一个网址上发送400和200

I have some code to get the Status Code with cURL. All the code works fine, but when I put more than 1 line on the textarea, the response return me just 200 on the last url

1.Define my own function
2.Trim the line from textarea
3.Call the function N times

Somebody know why?

<?php
function get_http_response_code($url) {

    $handle = curl_init($url);

    curl_setopt($handle, CURLOPT_NOBODY, true);
    curl_setopt($handle, CURLOPT_HEADER, true);
    curl_setopt($handle, CURLOPT_HTTPGET, true);
    curl_setopt($handle,  CURLOPT_RETURNTRANSFER, TRUE);

    /* Get the HTML or whatever is linked in $url. */
    $response = curl_exec($handle);

    /* Check for 404 (file not found). */
    $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    if($httpCode == 200 || $httpCode == 300  ) {
        echo "url buscada OK : " . $url . "status: ".$httpCode."<br>";

    }else{
        echo "url buscada : " . $url . "status: ".$httpCode."<br>";
    }

    curl_close($handle);


    }



    $text = trim($_POST['textareaname']);
    $textAr = explode("
", $text);
    $textAr = array_filter($textAr, 'trim'); // remove any extra  characters left behind

    foreach ($textAr as $line) {


    sleep(1);
    get_http_response_code($line);

    }

?>


<form action="" method="POST" role="form">
    <legend>Form title</legend>

    <div class="form-group">
        <label for="">label</label>
<textarea name="textareaname" id="input" class="form-control" rows="15" required="required"></textarea>
    </div>



    <button type="submit" class="btn btn-primary">Submit</button>
</form>