Porsche_maniak
Active Member
Need an idea with php.. [SOLVED MYSELF]
Hi there. I am php programmer myself but just can't think of idea in the current situation.
You know output buffering in php right? Well I need something like crazy function for input buffering or some kind of toString function as in javascript lol. For example from this code:
From my point of view this is impossible. But can you somehow give idea? Also It has to be that way. I don't need solution like 'why don't you put the entire test function in string..' . I need it captured,mirrored or whatever in variable.. in javascript we use test.toString();
Thanks
EDIT:
For everyone needed solution as me - well... there is !!!
You should use the reflectionfunction class in PHP (available from PHP5 version)
Here is some more info @ reflection - reconstruct/get code of php function - Stack Overflow
Merry Christmas everyone!
Hi there. I am php programmer myself but just can't think of idea in the current situation.
You know output buffering in php right? Well I need something like crazy function for input buffering or some kind of toString function as in javascript lol. For example from this code:
PHP:
<?php
capture_this('InVariable');
function test(){
echo 'I have PHP code in here';
file_get_contents('http://yahoo.com'); }
capture_this('end');
echo $InVariable; /// will output > function test(){ echo 'I have PHP code in here'; file_get_contents('http://yahoo.com'); }
?>
From my point of view this is impossible. But can you somehow give idea? Also It has to be that way. I don't need solution like 'why don't you put the entire test function in string..' . I need it captured,mirrored or whatever in variable.. in javascript we use test.toString();
Thanks
EDIT:
For everyone needed solution as me - well... there is !!!
You should use the reflectionfunction class in PHP (available from PHP5 version)
Here is some more info @ reflection - reconstruct/get code of php function - Stack Overflow
Merry Christmas everyone!
Last edited: