note 97059 added to function.file-get-contents

From: Date: Tue, 30 Mar 2010 14:29:02 +0000
Subject: note 97059 added to function.file-get-contents
Groups: php.notes 
Request: Send a blank email to php-notes+get-167532@lists.php.net to get a copy of this message
To Vlad: You could also use the identical comparison operator (===) which checks for the same data type (e.g. boolean). I'm trying to get in the habit of always using this unless I want implicit data type conversions. http://php.net/manual/en/language.operators.comparison.php <?php $result=file_get_contents("http://www.example.com"); if ($result === false) { // treat error } else { // handle good case } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 209.184.240.68 ---- Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php Edit -- https://master.php.net/note/edit/97059 Del: integrated -- https://master.php.net/note/delete/97059/integrated Del: useless -- https://master.php.net/note/delete/97059/useless Del: bad code -- https://master.php.net/note/delete/97059/bad+code Del: spam -- https://master.php.net/note/delete/97059/spam Del: non-english -- https://master.php.net/note/delete/97059/non-english Del: in docs -- https://master.php.net/note/delete/97059/in+docs Del: other reasons-- https://master.php.net/note/delete/97059 Reject -- https://master.php.net/note/reject/97059 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#167532) next »