I have an enormous file of HTML that I'd like to convert to one variable for output. So, something like:
<div class="section">
<h3>hey<? echo $anothervar ?></h3>
<input type="submit" id="submit" name="submit" value="Submit" class="button" />
</div>
to
$myvar;
$myvar="<div class=\"section\">
<h3>hey" . $anothervar . "</h3>";
$myvar.= "<input type=\"submit\" id=\"submit\" name=\"submit\" value=\"Submit\" class=\"button\" />
</div>";
ryv. except its a HUGE file, with PHP peppered in there, but I need to get it all in one variable to pass it and then return it. Is there an automated way to do this (hopefully on windows with something like NP++?) or at least a way to automate a good portion of this rather than taking me hours and hours of going through the lines?
EDIT: Everyone is debating why I want to do that. Here's the quick and perhaps boring response; I'm writing a plugin for WordPress that takes a shortcode and replaces it with the output of a single variable; if one just echoes (as it is done in the file I was given) then WP puts the shortcode output in a different place relative to the content. So, yes, you may not want to do this but that's the reason (http://codex.wordpress.org/Shortcode_API#Overview):
When the_content is displayed, the shortcode API will parse any registered shortcodes such as "[my-shortcode]", separate and parse the attributes and content, if any, and pass them the corresponding shortcode handler function. Any string returned (not echoed) by the shortcode handler will be inserted into the post body in place of the shortcode itself.