Answers for "php function call another phph file"

PHP
3

php import function from another file

File1.php :
<?php
  function first($int, $string){ //function parameters, two variables.
    return $string;  //returns the second argument passed into the function
  }
?>
  
File2.php :
<?php
  include 'File1.php';
  echo first(1,"omg lol"); //returns omg lol;
?>
Posted by: Guest on December-28-2020
0

phph call functions from other .php file

<?php
  include 'File1.php';
  echo myFunc(1,"Hello edureka"); 
?>
Posted by: Guest on September-06-2021

Code answers related to "php function call another phph file"

Browse Popular Code Answers by Language