I have a thing here. The page prints out a message that has many php queries and other stuff in it. Example: php: <?=commas($somestuff[5]+$somestuff[26]+$somestuff[27]/*$lol1+$lol2+$lol3+$lol4+$lol5*/)?> </font> went and knocked out ( <? if($somestuff[5]>0){?> <font color="#FFFFFF"> <?=commas($result[5])?> </font> guys <? } ?> <? if($somestuff[26]>0){?> <font color="#FFFFFF"> <?=commas($result[26])?> </font> girls <? } ?> etc etc etc PHP: While the HTML message that would be printed on the screen would look like: xx went and knocked out xx guys xx girls etc... HTML: So that said. My question is the following: Can I make the HTML a variable and put into the database? Not the php, only the html. Example: 145 went and knocked out 34 guys 22 girls. (those examples were just part of the long long code) If that can't be done I will have to make a nother text and pull each variable separately and insert to db.. Thanks.
Yes: <?php ob_start(); ?> <?=commas($somestuff[5]+$somestuff[26]+$somestuff[27]/*$lol1+$lol2+$lol3+$lol4+$lol5*/)?> </font> went and knocked out ( <? if($somestuff[5]>0){?> <font color="#FFFFFF"> <?=commas($result[5])?> </font> guys <? } ?> <? if($somestuff[26]>0){?> <font color="#FFFFFF"> <?=commas($result[26])?> </font> girls <? } ?> etc etc etc <?php $variable = ob_get_contents(); ob_end_clean(); PHP: $variable will contain the info. Peace,
I have a weird issue. <?php ob_start(); ?> *my php stuff* <?php $variable = ob_get_contents(); ?> PHP: It works when I try to echo $variable but when i use a mysql insert command nothing but blank will go into the database...