|
Posted by Carl on 12/29/05 02:35
Leszek wrote:
> Included -yes but I need to make sure that prog1.php is done before
> prog2.php starts
>
> Thanks.
> Leszek
>
>
Leszek,
Simply put, php programs are actually scripts which get interpreted from
the top down ( barring any inline methods ).
A simple example I think will illustrate your problem (or lack thereof).
The code for the 3 scripts is below.
//file test.php
<?php
include("test.inc-1.php");
include("test.inc-2.php");
echo "<br />Done!";
?>
//file test.inc-1.php
<?php
for ($x = 0; $x < 100; $x++) {
for ($y = 0; $y < 50; $y++) {
echo '- ';
}
echo '<br />';
}
?>
//file test.inc-2.php
<?php
echo '<br /> Now in test.inc-2.php';
?>
If you run the script 'test.php' you will see that all of the output
generated from test.inc-1.php is produced before the output from
test.inc-2.php. I don't think that there is any question which script
takes longer to run.
Does this answer your question, or is there something I am missing.
Cheers,
Carl.
Navigation:
[Reply to this message]
|