I'm trying to load an php file through ajax using load(). Here's my code:
var loadUrl = "myfile.php";
$("#lst-results").load(loadUrl);
So, when I do this, it works:
<?php
$test = 'Hi :3';
?>
<h3>Hi</h3>
<h3><?php echo $test ?></h3>
But I need to include a file that contain a lot of includes and functions using a lot of different classes. I've tryed to include this file and use it as a function like this, but does not work and Nothing appears int the load() results. This function return an array.
<?php
include 'path/myfile.php';
$result = myFunction();
?>
I can't figure out how to solve it. :(