0
<?php
$html_url = 'http://api.biblia.com/v1/bible/content/LEB.html?passage=John333&style=fullyFormatted&key=fd37d8';
$str_html  = file_get_contents($html_url);

Question:

It shows: Warning: file_get_contents(http://api.biblia.com/v1...

Is there a way that can hide this message, instead show a message such as "can not show the result"?

1
  • Mostly file_get_contents( is disabled on remote servers. You should use PHP Curl to get the html content from a url Commented May 20, 2013 at 7:00

3 Answers 3

0

Use @ symbol like this:

$html_url = 'http://api.biblia.com/v1/bible/content/LEB.html?passage=John333&style=fullyFormatted&key=fd37d8';
$str_html  = @file_get_contents($html_url);
Sign up to request clarification or add additional context in comments.

Comments

0

use @ to suppress warning..but it is not a preferable method to suppress warning/notices/errors, instead you should try to debug your code to check what is going wrong behind the scene.

error_reporting() is another way of handling these errors.

2 Comments

Which one is preferable then?
my lateer comment makes it more clear with what preferable means in the current context
0
error_reporting(0);

try this link

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.