how to handle php function error
<p>How do i form an if/else statement for a php function failing? I want it to define $results one way if it works, and another if it doesnt. I simply dont want to show an error, or kill the error message if it fails though.</p>

<p>currently, i have;</p>

<pre><code>if(file_get_contents("http://www.address.com")){
    $results = "it worked";}
else {
    $results = "it didnt";}
return $results
</code></pre>
