title: Fatal error! Object of class Closure could not be converted to string
body: <p>i've made this simple shopping cart, where i've made this if and else function that goes inside a variable that gets called in my mail body, and this error message shows up when you submit the values:
  Fatal error! Object of class Closure could not be converted to string</p>
  
  <p>Here's part of the variable function code:</p>
  
  <pre><code>$varer= function ($string) {
  if ($_POST['smu']&gt;= 1) 
  {
  "===========================================
  Pilotjakke pelsforet Grå: \r\n
  $pilotjakkegrå \r\n\r\n
  ===========================================" ;
  }
  else if($_POST['smu']&lt;= 0)
  {
      "";
  }
  
  //
  </code></pre>
  
  <p>and this is the email body part:</p>
  
  <pre><code>$body = "
  
  
  Bekreftelse på bestilling:
  \r\n\r\n 
  
  Navn: $name_field\r\n 
  ===========================================
  E-Mail: $email_field\r\n 
  ===========================================
  Firma: $firma\r\n 
  ===========================================
  Adresse: $adresse\r\n 
  ===========================================
  Poststed: $poststed\r\n 
  ===========================================
  Postnummer: $postnummer\r\n 
  ===========================================
  Firma: $firma\r\n 
  ===========================================
  Telefon: $tlf\r\n 
  ===========================================
  Message: $message\r\n\r\n
  =====================================================================================
  Takk for at du bestilte hos oss, orderen din vil sett på og du vil motta en faktura snart. 
  \r\n\r\n
  =====================================================================================
  Varebestillingen : 
  $varer
  \r\n\r\n
  ===========================================
  Total Order Sum: $order kr
  ===========================================
  ";
  </code></pre>
  
  <p>and i get an error line where $varer is. I tried to convert it to a string but i probably did that all wrong.</p>
  
  <p>You can take a look at the site here : <a href="http://www.premiere-produkter.no/pp/lagersalg/index.php" rel="nofollow">http://www.premiere-produkter.no/pp/lagersalg/index.php</a></p>