Remove last string value in foreach loop : <p>I have a  loop in php </p>

<pre><code>foreach($Array as $key =&gt;$value) 
 {
     $TotalLine .=  " Qualification =".$value." OR ";
 }
  echo $TotalLine;
</code></pre>

<p>Prints</p>

<pre><code>  Qualification =1 OR Qualification =2 OR Qualification =3 OR Qualification =4 OR
</code></pre>

<p>Now i need to remove last <strong>OR</strong> in that line, Desired Output must look like</p>

<pre><code> Qualification =1 OR Qualification =2 OR Qualification =3 OR Qualification =4 
</code></pre>

<p>How to do this. Any help appreciated. </p>
