parsing - How to parse current PHP file after it is loaded? -



parsing - How to parse current PHP file after it is loaded? -

i have php page receives post attributes.this page rendered depending upon these attributes. want source code of php page after populated received attributes. page plain html code after has been parsed php parser. have referred file_get_contents , php simple html dom parser couldn't find acceptable answer.

what want raw html code after has been parsed php parser

example

echo "<p>hi<p>"

and page return

<p>hi</p>

i want output above.

you need utilize php's output command functions output generated php.

example:

<?php // here on, maintain output in buffer ob_start(); // output whatever want echo "<h1>hello world!</h1>" . php_eol; echo "<p>how're doin' today?</p>"; // store contents of buffer in $output $output = ob_get_contents(); // clear buffer , stop buffering output ob_end_clean(); // show output caught using buffer var_dump($output); ?>

output:

string(52) "<h1>hello world!</h1> <p>how're doin' today?</p>"

php parsing simple-html-dom

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -