I have a script that retrieves PHP variables using the $get() function but I have multiple requests for each variable. I want to do this because I want the calls to be individual and not waiting to load all variables.

Here is my simple code:

FUNCTIONS.PHP

```
$content1 = 'This is a good solution.';
$content2 = 'This is another good solution.';

if(preg_match('[good]', $content1)) { 

$result1 = "<p>Great, we found something here.</p>";

}else{

$result1 = "<p>Oops, nooooo.</p>";
}
/////////////////////////////////

if(preg_match('[another]', $content2)) { 

$result2 = "<p>Great, we found something here.</p>";

}else{

$result2 = "<p>Oops, nooo.</p>";
}

$action = $_GET['action'];

switch ($action) {
case 'result1':
echo $result1;
break;
case 'result2':
echo $result2;
break;
default:
echo 'Test';

}

```

GET.PHP

```
<script type='text/javascript'>

$.get('functions.php?action=result1', function(data) { 

$('.result1').html(data);

});

$.get('functions.php?action=result2', function(data) { 

$('.result2').html(data);

});

</script>

<div class="result1"></div>
<div class="result2"></div>
<div class="result3"></div>
<div class="result4"></div>
........

```

So how can I "combine" all javascript calls to one (using parameters, I do not know) so will not be necesary to create a call for each variable.

```
 <script type='text/javascript'>

$.get('functions.php?action=resultvariable', function(data) { 

$('.result_variable...').html(data);

});

</script>

```