Escape the ? in a variable

March 5, 2012 at 03:08:14
Specs: Windows Vista
How do I escape "?>" when trying to put a php echo statement into a variable? Example: ${$detailselection} = "<?php echo ${$provdetailvar} ?>"; The ?> at end is closing off rest of the php script.
Actually, the entire section of code has two places where need the escape: if (${$activityselection} != "Formal training by AFSCĀ® Corporate Member: Training Institute (Feng Shui)") {
${$detailselection} = "<textarea rows=\"4\" name=\"<?php echo $provdetailvar ?>\" cols=\"50\" maxlength=\"200\"><?php echo ${$provdetailvar} ?></textarea>";

See More: Escape the ? in a variable

Report •

March 5, 2012 at 04:27:42
Actually not sure if the ?> at the end or the <?php at beginning is what is killing the php following the statement. I tried using entities in place of brackets and didn't the "interior" php statement rather than having the variable echoed LOL. Back to drawing board. Any help on this would be appreciated. Thanks.

Report •

March 5, 2012 at 13:48:46
I redesigned and approached from another direction and got it working. My initial effort was trying to drill it into a deeper level than it needed to be DUHHHH. Although nobody responded before I figured out another way to go....thanks for any help anybody might have been willing to give. I'll probably be back with another question sooner than later. I'm self taught PHP with no formal training and there is plenty still that confuses me.

Report •
Related Solutions

Ask Question