0

In index.php I included some function from file (for example myfunc()) and some file (myfile.php). In file.php I'm try use this function.

Uncaught Error: Call to undefined function myFunc...

Example code:

index.php:

<?php
require_once "./myfunc.func.php";
require_once "./myfile.php";

myfunc.func.php:

<?php
function myfunc()
{
    echo "myfunc test";
}

myfile.php:

<?php
myfunc();
CoolONE
  • 89
  • 4
  • 8

2 Answers2

0

From what i see in the code of 'myfunc.func.php' you have not added the parenthesis on the 'myFunc' function

Maybe its because you copied and pasted here i dont know but all functions need to have parenthesis even if they have no parameters.

Friendly, Damian

Damian
  • 113
  • 8
0

Sorry, this example good. Probably a bug in my code..

CoolONE
  • 89
  • 4
  • 8