simon551 Posted June 11, 2007 Share Posted June 11, 2007 trying to print out a " but no luck: <?php print "<div id=\"CollapsiblePanel".($i & 1). "/"" . " class=\"CollapsiblePanel\">";?> Thanks in advance for any input. Quote Link to comment https://forums.phpfreaks.com/topic/55175-parse-error-syntax-error-unexpected-t_constant_encapsed_string/ Share on other sites More sharing options...
papaface Posted June 11, 2007 Share Posted June 11, 2007 Your code doesnt make sense. try: <?php echo '<div id="CollapsiblePanel'.$i. '" class="CollapsiblePanel">';?> Not sure what you are trying to do here: .($i & 1). Quote Link to comment https://forums.phpfreaks.com/topic/55175-parse-error-syntax-error-unexpected-t_constant_encapsed_string/#findComment-272716 Share on other sites More sharing options...
simon551 Posted June 11, 2007 Author Share Posted June 11, 2007 Thanks! Is there any difference between your suggestion (which works!) and this (below) which also works? I couldn't have figured this out w/out your suggestion. I remember somewhere about the single/double quote alternation but totally forgot. <?php print "<div id=\"CollapsiblePanel".($i). '"' . " class=\"CollapsiblePanel\">";?> Quote Link to comment https://forums.phpfreaks.com/topic/55175-parse-error-syntax-error-unexpected-t_constant_encapsed_string/#findComment-272723 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.