How can I use $mail->SMTPDebug as a string?
===

I want to echo "Fail" if strlen $mail->SMTPDebug is more than 10. But I don't know how to use $mail->SMTPDebug as a string. The below line in the function enables the debugging. 

    $mail->SMTPDebug  = 1;     

But can't use my if statement on it in my function. How can I do that ?


    function mailsender($val,$yollayan,$sifresi,$name,$subject,$message) {
    
    $mail = new PHPMailer();  
    $mail->IsSMTP();               
    $mail->SMTPDebug  = 1;          
    $mail->SMTPAuth = true;         
    $mail->SMTPSecure = "tls";      
    
    $mail->Username   = $yollayan;
    $mail->Password   = $sifresi;
    
    $mail->Host = "smtp.live.com";  
    $mail->Port = "587";  
    
    
    $mail->From = $yollayan;
    $mail->Fromname = $name;
    $mail->name = $name;
    
    
    $mail->Subject = $subject;  
    $mail->Body = $message;  
    $mail->AddAddress($val);   
    $mail->send();
    
    }