当我尝试回显此字符串时显示“0”
我在我的本地服务器和http://writecodeonline.com/PHP/上尝试过这两次同样的事情.这在我之前从未发生过,它是什么,我该如何解决?提前致谢.
<?PHP $info = ' <div id="gallery_option_###number###"> <a href="#galleryButton###number###" onclick="gallery_button_down(' + "'###number###'" + ')"> Burn Notice </a> <div id="info_option_###number###"> <!-- [title]title[|title] [description]test[|description] [image]url[|image] --> </div> </div>'; echo $info; ?>
您正在遵循JavaScript串联连接的方式.
读:
http://php.net/manual/en/language.operators.string.php
<?PHP $a = "Hello "; $b = $a . "World!"; // now $b contains "Hello World!" $a = "Hello "; $a .= "World!"; // now $a contains "Hello World!" ?>