Hello! I want to concatenate PHP variables with JavaScript. But it does not work; My code is as follows: <?php $name3 = "http://a1708.g.akamai.net/7/1708/110/AH0632217021784/www.shopnbc.com/images/linkshare_banners/logos/shopnbc_125x125.gif"; echo '<script type="text/javascript"> seqslides[0]=["$name3", http://www.dynamicdrive.com"] </script>'; ?> Code (markup): Help me to concatenate above $name3 variable with javascript. Pls
Because the string you're echoing is between single quotes, and variables won't be parsed between single quotes. Use double quotes, or do: echo '<script>... "' . $name3 . '" ...</script>'; PHP: