php echo html and php code -


how can add line of code in

<a href='/<?=$value["content_url"];?>' class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"><?=$value["content_title"];?><span class="caret"></span></a> 

so this:

if (1 == 1) {      echo "<a href='/<?=$value["content_url"];?>'      class="dropdown-toggle" data-toggle="dropdown" role="button"      aria-haspopup="true" aria-expanded="true"> <?=$value["content_title"];?>     <span class="caret"></span></a>"; } else {      echo "nothing see!"  } 

because have multiple punctuations end echo quick..

format string properly. updated string.

if (1 == 1) {      echo "<a href=\"$value[content_url]\"       class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\"       aria-haspopup=\"true\" aria-expanded=\"true\">$value[content_title]      <span class=\"caret\"></span></a>"; } else {      echo "nothing see!";  } 

inside double quoted string php variables don't need quoted. escape quotes backslash.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -