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)