How to count invalid rows in csv file using php?

This HTML page…

        .style1 {font-family: "Times New Roman", Times, serif}
    </style>
</head>
<body>
    <div style="margin-left:50px; margin-top: -1em;font-family: initial;">
        <h3>Bulk Sms</h3></div>
    <form name="import" method="post" enctype="multipart/form-data" action=''>
        <table border="3" style="margin-left:500px;margin-top:5px;font-family: initial;">
            <tr><td>
                    YOUR MOBILE NO:<input name="fromno" type="text" size="37" maxlength="10"></td></tr>
            <tr><td>TYPE MESSAGE:<textarea onKeyPress=check_length(this.form); onKeyDown=check_length(this.form); name=my_text rows=4 cols=30></textarea></td></tr>
            <br>                               
            <tr><td><input size=1 value=160 name=text_num> Characters Left</td></tr>
            <tr><td><input type="submit" class="btn btn-info" value="SendSMS">
                    <div style="margin-left:110px;margin-top: -26.5px ;">
                        <input type="file" name="csv" id="csv" />
                    </div>
                    <div style="margin-left:338px;margin-top: -35px;">
                        <input type="submit"class="btn btn-info" value="Submit" name="submitbtn" id="submitbtn">
                    </div>
        </table>
    </form>.
    <div id="loadmsg">
        
    </div>
    <div style="margin-left:553px; margin-top:-2em;">

    </div>
</body>