Possible Duplicate:
PHP Regex extract a javascript variable
This is really probably just a simple string manipulation question that needs a good regex solution.
I have some javascript variables defined in an HTML page. I want to read the page in to PHP, identify the variable I want to change; and update it. The vars look like:
rsp.pageId = 'sports'
Just to be clear, my script will not know what the value is so in the example 'sports' could be anything; so it's a wildcard where the rest of the string is consistant. I don't know if it would be easier to wrap some comments around the var/value to get to it easier?
I appreciate the help. I'm playing with a DOM manipulation library so I thought about wrapping script tags around each variable and putting an ID on each. I think that would work but seems like the output would be a bit ridiculous.