我想要得到这个
<style type="text/css">
.hidden {
display: none;
}
</style>
<form>
<input type="submit" id="submit" onclick="document.getElementById('hidden').style.display = 'block';" />
</form>
<img id="hidden" class="hidden" src="http://mmgtv.org/limelight/wp-content/themes/technetiumastic/images/loader.gif" />
进入这个
$content .= 'I AM TRYING TO PUT THE CODE INTO HERE';
我该怎么办?
答案 0 :(得分:1)
您可以使用HEREDOC语法:
$content. = <<<EOD
<style type="text/css">
.hidden {
display: none;
}
</style>
<form>
<input type="submit" id="submit" onclick="document.getElementById('hidden').style.display = 'block';" />
</form>
<img id="hidden" class="hidden" src="http://mmgtv.org/limelight/wp-content/themes/technetiumastic/images/loader.gif" />
EOD;
答案 1 :(得分:0)
$content = '<style type="text/css">
.hidden {
display: none;
}
</style>
<form>
<input type="submit" id="submit" onclick="document.getElementById(\'hidden\').style.display = \'block\';" />
</form>
<img id="hidden" class="hidden" src="http://mmgtv.org/limelight/wp-content/themes/technetiumastic/images/loader.gif" />';
但为什么?
答案 2 :(得分:0)
是肯定的。使用转义字符:
$content .= '<style type="text/css">';
$content .= '.hidden {';
$content .= 'display: none;';
$content .= '}';
$content .= '</style>';
$content .= '<form>';
.....
$content .= ' <input type="submit" id="submit" onclick="document.getElementById(\'hidden\').style.display = \'block\';" />';
查看如何将反斜杠添加到最后一行代码中。