hi all i can somone help me write a simple php script that will read a txt file called output.txt

this is what output.txt will look like

Total messages: 146
Messages with local recipients: 0
Messages with remote recipients: 146
Messages with bounces: 0
Messages in preprocess: 0

check the Total messages line and if the number is greater than 100 then output another text file with the word "overloaded" if its less the 100 then output to the same text file with the word "normal"

so in the case about it will output to a file called result.txt with the word overloaded

cheers aron

    ok i have written this script up but its not working.

    it shows overloaded even when its below 100..

    the .txt file is called

    output104.txt

    it contains for example ( if their is 5 emails in queue then it would show Total messages: 5 )

    Total messages: 150
    Messages with local recipients: 0
    Messages with remote recipients: 0
    Messages with bounces: 0
    Messages in preprocess: 0

    this is the php script

    <?php
    // set source file name and path
    
    $vps = $_REQUEST["vps"];
    
    $source = "output$vps.txt";
    
    // read raw text as array
    $raw = file($source) or die("Cannot read file");
    
    // retrieve first lines 
    $Total_messages = array_shift($raw);
    
    echo $Total_messages;
    
    if ($Total_messages <= '100') {
        echo "Normal";
    }
    else
    {
        echo "Overload";
    }
    
    ?>
      Write a Reply...