Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Inline functions PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 189
    Comment on it

    Welcome to Findnerd. Today we are going to discuss the inline functions in php. PHP implements inline functions concept is different from other programming language. In php you can define the function inside other function. Please have a look.

    <?php
    
    
        function myline () {
            function ourline() {
                echo "Welcome to Findnerd";
            }
            ourline();
        }
    
        myline();
        ?>
    

    In above example we created function named myline and also created new function inside it. You need to call this function inside the myline function otherwise it will throw the error out of scope.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: