How to assign a PHP variable that contains a mixed of PHP and html elements?
- by Rick
I have a PHP page that contains html and tags and PHP codes and I am using AJAX to manipulate some data and now I need to spit out the response but I am not sure if it is possible to put the mixed content into a string variable to pass through...
Is this possible? For example I need to:
$response = "<p>some text--<?php echo $something; ?>";
Thanks...
To clear things up, I am not trying to send raw PHP code to clientside as that would be silly and won't be evaluated as it is a server side script. I am just looking for a fast way to put everything into a variable without manually re-doing the whole page stripping out the php open and close tags and echos...etc