List Info

Thread: note 71437 added to function.eval




note 71437 added to function.eval
user name
2006-11-29 03:33:35
This is a variation on Dale's code, however, this will allow
you to parse php within any type of file - yes, I actually
found a use for this ;) 

<?php
flush(); // send/empty current buffer (however, see
ob_flush() if you experience problems)
ob_start(); // start recording
eval("?>".file_get_contents("stuff.foo&quo
t;)); // break out from php mode, but evaluate any php code
present in the file
$stuff = ob_get_contents(); // grab output buffer and treat
as string
ob_end_clean(); // discard buffer and stop buffering
?>
----
Server IP: 195.184.96.15
Probable Submitter: 130.226.173.20
----
Manual Page -- http:/
/www.php.net/manual/en/function.eval.php
Edit        -- https://master
.php.net/note/edit/71437
Del: integrated  -- h
ttps://master.php.net/note/delete/71437/integrated
Del: useless     -- http
s://master.php.net/note/delete/71437/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/71437/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/71437/spam
Del: non-english -- 
https://master.php.net/note/delete/71437/non-english
Del: in docs     -- http
s://master.php.net/note/delete/71437/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/71437
Reject      -- https://mast
er.php.net/note/reject/71437
Search      -- https://
master.php.net/manage/user-notes.php

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

note 71437 deleted from function.eval by colder
user name
2006-11-29 07:43:19
Note Submitter: holger at doessing dot net
Reason: bad code

----

This is a variation on Dale's code, however, this will allow
you to parse php within any type of file - yes, I actually
found a use for this ;) 

<?php
flush(); // send/empty current buffer (however, see
ob_flush() if you experience problems)
ob_start(); // start recording
eval("?>".file_get_contents("stuff.foo&quo
t;)); // break out from php mode, but evaluate any php code
present in the file
$stuff = ob_get_contents(); // grab output buffer and treat
as string
ob_end_clean(); // discard buffer and stop buffering
?>

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

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )