title: Concatenating php date type variable with other strings while creating a custom file name in php
body: <p>I have been trying to use my variable $date of type date to concatenate with some other string so as to make a custom file name which I will use it in my program.I tried the following ways after going through some links but I failed.</p>
  
  <pre><code>$bar="foo".$date.".txt";
  
  $bar="foo".string($date).".txt";
  
  $bar="foo"."$date".".txt";
  </code></pre>
  
  <p>It always omits $date variable and creates a file with name foo.txt. But I am looking for some thing like foo4/2/15.txt if value of $date is 4/2/15.
  That would be great if some one help me with this. </p>