Sending multiple PHP files with AJAX
<p>Usually when I want to create new content in a php file and implement it somewhere in my site I do something like this (JS and PHP):</p>

<pre><code>    case 'someCasename':
    ...
    include_once 'file.php';
    break;

...
success: function(data){
    $("#idSelector").html(data);
}
</code></pre>

<p>and the new content is displayed at the selected element.</p>

<p>But im curious on if its possible to send multiple php files at the same time. Not sure if this is really necessary and I've not come across a single time where I need to do this but I thought of the it and wanted to ask. This last code is most likely very very wrong but I just want to showcase what i mean:</p>

<pre><code>    case 'someCasename':
...
$phpArray = array("file1" =&gt; include_once 'file1.php', "file2" =&gt; include_once 'file2.php', "file3" =&gt; include_once 'file3.php'):
echo $phpArray;
break;

...
success: function(data){
    $("#idSelector").html(data.file1);
    $("#idSelector").html(data.file2);
    $("#idSelector").html(data.file3);
}
</code></pre>

<p>Is something like this even remotly possible? You cant json_encode php files can you?</p>
