tags:

views:

50

answers:

2

hi! i've two files

a.php which contains <?php echo "i'm a.php"; ?>

and b.php which contains

<?php 
echo "i'm b.php";
// some code here to "execute" a.php so that it prints i'm a.php as the output.
?>

so finally, when i click on b.php it should display:

i'm b.php

i'm a.php

+2  A: 
 <?php 
 echo "i'm b.php";
 include('a.php');
 ?>

C.

symcbean
if the a.php file has reference to other files inside it, will it execute correctly? thanks for ur reply
Sam
+1  A: 

just universal solution (but maybe denied by local PHP-server configuration):

echo file('http://your-remote-host/path/a.php');

or your a.php must provide some gate:

<? # a.php
function a_php_output()
{
return "i'm a.php";
}
?>

<? # b.php
echo "i'm b.php";
include('a.php');
echo a_php_output();
?>
UncleMiF