Ok, so I'm trying to modify a BBCode Parsing Script to output php (like include and stuff such as that). Is it possible for php to output php? If so, how would it be done?
Here's a snippet of my bbcode parsing script:
<?php
/*
==METHOD:==
include ('ubb2.php3');
Then, get your self a variable with text in it.
You can read in a text file
for example with something like:
$textfile = file("yourfile.txt");
OR
$textfile = implode("", $textfile);
Then you just run the UBB function on that sucker
$textfile = Do_Ubb($textfile);
And finally, you'll probably want to print it:
print $textfile;
*/
function Do_Ubb ($article) {
$article = nl2br($article);
#do UBB code
$article = str_replace("{asdfg}","<? include ('asdfg.php'); ?>",$article);
#all done, return the stuff
return $article;
}
?>
Ok, I hacked alot of out that script, so thats not the full script, so there could be some syntax errors - whatev, thats not the point. So like I said before, is it possible for php to output more php?