php - ob_get_content() output incorrect -
i'm experiencing problems ob_start function, due new php 5.5
what i'm trying render php 3rd file using within ob_start.
here code:
function fetch() { extract($this->a_vars); // extract vars local namespace ob_start(); include (templateclass.php); // file 'text' $s_contents = ob_get_contents(); ob_end_clean(); homecoming $s_contents; }
basically i'm doing extracting variables in local namespace templateclass utilize render/show pieces of text, example:
... function func1() { homecoming true; } <?if(isset($var1)):?> function func2() { homecoming 2; } <?endif;?> ...
but variable $s_contents has content of file including php code within not beingness interpreted. need php blocks interpreted , output final usable php class.
any idea?
php ob-start php-5.5 ob-get-contents
No comments:
Post a Comment