Why does file_get_contents() return the error "Filename cannot be empty"?
<p>I'm pretty much a complete newbie to PHP. My background is C/C++ and C#. I'm trying to object orient-ify some simple PHP code, but I'm doing something wrong.</p>

<p>Class code:</p>

<pre><code>class ConnectionString
{
  public $String = "";
  public $HostName = "";
  public $UserName = "";
  public $Password = "";
  public $Database = "";

  function LoadFromFile($FileName)
  {
    $this-&gt;String = file_get_contents($Filename);
    $Values = explode("|", $this-&gt;String);
    $this-&gt;HostName = $Values[0];
    $this-&gt;UserName = $Values[1];
    $this-&gt;Password = $Values[2];
    $this-&gt;Database = $Values[3];
  }
}
</code></pre>

<p>Calling code:</p>

<pre><code>$ConnectionString = new ConnectionString();
$FileName = "db.conf";
$ConnectionString-&gt;LoadFromFile($FileName);
print('&lt;p&gt;Connection Info: ' . $Connection-&gt;String . '&lt;/p&gt;');
</code></pre>

<p>I'm getting ann error on the <code>file_get_contents($Filename)</code> line stating: <em>Filename cannot be empty</em>.  If I hard-code the filename in place of $Filename, then I simply get all empty strings for the fields.</p>

<p>What simple concept am I missing?</p>
