I have one line in php file like this:
<a class="hide-if-no-js" onclick="findPosts.open( 'media[]','<?php echo $post->ID ?>' ); return false;" href="#the-list">Attach</a>
I need to write this line as a string in a php function, I tried this:
$output .="<a class='hide-if-no-js' onclick='findPosts.open( 'media[]','$id' ); return false;' href='#the-list'>'$linktext'</a>";
Seems the quote around 'media[]' is wrong and made the html of this line messed up. Could anybody help correct me?