Store blocks of text in PHP variable
I have a bunch of javascript files I need to parse via PHP (I don't want to push them to the browser; I want to do this fully in the backend), and they all contain a variable declaration, for example (actual content of one of the js files):

    var x = '<html><div class="foo">blocks of text</div></html>';

Basically they all enclose html within single quotes, and the variable is always the same (x in this case).  What's the best way to extract everything inside the single quotes into a PHP variable?
Store blocks of text in PHP variable
===

I have a bunch of javascript files I need to parse via PHP (I don't want to push them to the browser; I want to do this fully in the backend), and they all contain a variable declaration, for example (actual content of one of the js files):

    var x = '<html><div class="foo">blocks of text</div></html>';

Basically they all enclose html within single quotes, and the variable is always the same (x in this case).  What's the best way to extract everything inside the single quotes into a PHP variable?