Php echo , change of manner of printing
<p>i've got this quick question:</p>

<p>I have this code which is all ok, but what i need is to print it in a different way, and i've tried something but the problem is, i don't get any error, but the result doesn't go the right way,</p>

<p>The code i'm trying to print is this:</p>

<pre><code>&lt;ul class='star-rating' id="star-rating-&lt;?php echo $star['id'];?&gt;"&gt;
&lt;?php /* getRating($id) is to generate current rating */?&gt;
  &lt;li class="current-rating" id="current-rating-&lt;?php echo $star['id'];?&gt;" style="width:&lt;?php echo getRating($star['id'])?&gt;%"&gt;&lt;!-- will show current rating --&gt;&lt;/li&gt;
  &lt;?php 
  /* we need to generate 'id' for star rating.. this 'id' will identify which data to execute  */
  /* we will pass it in ajax later */
  ?&gt;
  &lt;span class="ratelinks" id="&lt;?php echo $star['id'];?&gt;"&gt;
  &lt;li&gt;&lt;a href="javascript:void(0)" title="1 star out of 5" class="one-star"&gt;1&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="javascript:void(0)" title="1 star and a half out of 5" class="one-star-half"&gt;1.5&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="javascript:void(0)" title="2 stars out of 5" class="two-stars"&gt;2&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="javascript:void(0)" title="2 star and a half out of 5" class="two-star-half"&gt;2.5&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="javascript:void(0)" title="3 stars out of 5" class="three-stars"&gt;3&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="javascript:void(0)" title="3 star and a half out of 5" class="three-star-half"&gt;3.5&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="javascript:void(0)" title="4 stars out of 5" class="four-stars"&gt;4&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="javascript:void(0)" title="4 star and a half out of 5" class="four-star-half"&gt;4.5&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="javascript:void(0)" title="5 stars out of 5" class="five-stars"&gt;5&lt;/a&gt;&lt;/li&gt;
  &lt;/span&gt;
&lt;/ul&gt;
</code></pre>

<p>While i'm trying this:</p>

<pre><code>echo"&lt;ul class='star-rating' id='star-rating-'". $star['id']."&gt;
 &lt;li class='current-rating' id='current-rating-".  $star['id']." style='width:". getRating($star['id'])."'%&gt;&lt;/li&gt;";
 echo'&lt;span class="ratelinks" id="'. $star['id'].'"&gt;
  &lt;li&gt;&lt;a href="javascript:void(0)" title="1 star out of 5" class="one-star"&gt;1&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="javascript:void(0)" title="1 star and a half out of 5" class="one-star-half"&gt;1.5&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="javascript:void(0)" title="2 stars out of 5" class="two-stars"&gt;2&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="javascript:void(0)" title="2 star and a half out of 5" class="two-star-half"&gt;2.5&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="javascript:void(0)" title="3 stars out of 5" class="three-stars"&gt;3&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="javascript:void(0)" title="3 star and a half out of 5" class="three-star-half"&gt;3.5&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="javascript:void(0)" title="4 stars out of 5" class="four-stars"&gt;4&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="javascript:void(0)" title="4 star and a half out of 5" class="four-star-half"&gt;4.5&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="javascript:void(0)" title="5 stars out of 5" class="five-stars"&gt;5&lt;/a&gt;&lt;/li&gt;
  &lt;/span&gt;
&lt;/ul&gt;';
</code></pre>
