[PHP] Can you read a parsing PHP page's results

2002-11-12 Thread Colin Kettenacker
Is there anyway at all of reading the results of a parsing PHP page from
within that same PHP page itself. In other words can you read the HTML code
it's going to create. I know that you can use regular expressions to parse
the HTML page manually swapping variable content as you would with most any
template system... I guess I am asking if you can get the results of an echo
statement. If I had to write it in pseudo code it would be this:

$htmlCode = echo $myPHPcontent;

I find it highly unlikely but I thought I'd toss it out to those who know.

TIA,

ck

PS: I am a newbie who genuinely for the past hour has searched the archives,
the manual and tried writing several scripts to make this work with no
success. Forgive me if I missed something obvious.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Can you read a parsing PHP page's results

2002-11-12 Thread John W. Holmes
 Is there anyway at all of reading the results of a parsing PHP page
from
 within that same PHP page itself. In other words can you read the HTML
 code
 it's going to create. I know that you can use regular expressions to
parse
 the HTML page manually swapping variable content as you would with
most
 any
 template system... I guess I am asking if you can get the results of
an
 echo
 statement. If I had to write it in pseudo code it would be this:
 
 $htmlCode = echo $myPHPcontent;
 
 I find it highly unlikely but I thought I'd toss it out to those who
know.

You can do it with output buffering. 

http://www.php.net/manual/en/ref.outcontrol.php

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php