When I try and echo this string it shows "0"
I tried it on my local server and on http://writecodeonline.com/php/
both times same thing happened. This has never happened to me before, what is it and how do I fix? Thanks in advance.
<?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;
?>
You are following JavaScript way of string concatenation.
Read:
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!"
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With