anauj0101 Posted May 31, 2009 Share Posted May 31, 2009 I am trying to echo <a href="fear1.jpg" onclick="change('fear1.jpg'); return false;">fear1.jpg</a><br> I'm using this code and i probably have it all messed up. please help echo "<a href=\"" + $file +"\" onclick=\"change(\'" + $file + "\')\; return false\;\">"+ $file + "</a><br>"; Link to comment https://forums.phpfreaks.com/topic/160318-solved-echo-with-special-characters/ Share on other sites More sharing options...
Michdd Posted May 31, 2009 Share Posted May 31, 2009 echo '<a href="' . $file . '" onclick="change(\'' . $file . '\'); return false;">' . $file . '</a><br>'; Link to comment https://forums.phpfreaks.com/topic/160318-solved-echo-with-special-characters/#findComment-846014 Share on other sites More sharing options...
DarkSuperHero Posted May 31, 2009 Share Posted May 31, 2009 to concatenate anything in php, you use . (dot) not a plus.... is what Michdd was saying, many languages like Javascritp and ActionScript and others use a plus, but not php... http://us3.php.net/language.operators.string Link to comment https://forums.phpfreaks.com/topic/160318-solved-echo-with-special-characters/#findComment-846032 Share on other sites More sharing options...
anauj0101 Posted May 31, 2009 Author Share Posted May 31, 2009 Thanks I have a ton of php and java on this page and mixed stuff up. Link to comment https://forums.phpfreaks.com/topic/160318-solved-echo-with-special-characters/#findComment-846406 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.