I have a PHP script in which I am trying to write a fairly complex piece of html and I can't seem to get the coding of the PHP echo statement. There are single and double quotes scattered throughout this line of html and it is driving me nuts attempting to manage the output. So far, the only way I can get it to work is to break the echo'ing of the line of html code into the following lines of PHP:
HTML
echo "\t" ;
echo '<li><a href="';
echo $full_dir . $file ;
echo '" alt="full-size"><img src="' ;
echo $dir . $file ;
echo '" alt="' ;
echo $dir . $file ;
echo '" ><img src="' ;
echo $mid_dir . $file ;
echo '" alt="mid-size" class="preview" /></a></li> ';
echo "\n\r\t";
echo '<li><a href="';
echo $full_dir . $file ;
echo '" alt="full-size"><img src="' ;
echo $dir . $file ;
echo '" alt="' ;
echo $dir . $file ;
echo '" ><img src="' ;
echo $mid_dir . $file ;
echo '" alt="mid-size" class="preview" /></a></li> ';
echo "\n\r\t";
The script is managing to correctly output a string of html as follows:
HTML
<li>
<a href="full_images/pict0023.jpg" alt="full-size">
<img src="images/pict0023.jpg" alt="images/pict0023.jpg" >
<img src="mid_images/pict0023.jpg" alt="mid-size" class="preview" /></a>
</li>
<a href="full_images/pict0023.jpg" alt="full-size">
<img src="images/pict0023.jpg" alt="images/pict0023.jpg" >
<img src="mid_images/pict0023.jpg" alt="mid-size" class="preview" /></a>
</li>
I have broken it down into segments with carriage returns in this example, but it could be a single, continuous piece of code, too.
This sample of PHP code works correctly in a Browser, so it isn't an issue with the 'correctness' of the html, it has to do with the complexity of the single and double quotes and the PHP required to output this line as one string instead of the 11 echo statements.
I will continue to make some attempts, but so far I just am not managing to sort out the method of escaping the right pieces of code and arranging all the bits and pieces. Any suggestions for cleaning up and leaning out this code would be appreciated.

