I want to call my custom php function from my index.php, but the function is located in another file. Ho to do that ?
Example :
index.php :
<?php
myCustomFunction();
?>
function.php
<?php
function myCustomFunction(){
//some codes
}
?>
Thank you.
Change index.php as follows:
<?php
include "function.php";
myCustomFunction();
?>
(this is based on the assumption that both files are in the same directory, otherwise you have to add the filepath in the include
line)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With