• what is static variable in php?

    what is static variable in php?

    output following Query:- 

     

    <?php
    
    function abc(){
    
    static $abc=1;
    
    $abc++;
    
    return $abc;
    
    }
    
    echo abc();
    
    echo abc();
    
    echo abc();
    
    echo abc();
    ?>
    

     

    Silver Member Asked on August 10, 2018 in Php.
    Add Comment
  • 1 Answer(s)
    Best answer

    Output:- 2345

    Silver Member Answered on August 10, 2018.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.