我试图以不同的方式使用 我收到了错误消息 p>
< a href =“https://i.stack.imgur.com/ifgRg.png”rel =“nofollow noreferrer”> 但是当我以正常方式使用此代码时,它可以正常工作。 请参阅下面的工作代码 p>
我的问题是,我将在变量中获取URL,我需要从那里开始。 所以我不能直接把URL。 p>
div> file_get_contents code>。 不知怎的,这种方式不起作用。 请参阅代码 p>
&lt;?php
$ attrb =“https://html5andcss3.org”;
$ htmlcontent = file_get_contents(“'”。$ attrb 。“'”);
echo $ htmlcontent;
?&gt;
code> pre>
p>
&lt;?php
$ htmlcontent = file_get_contents('https://html5andcss3.org');
echo $ htmlcontent;
? &gt;
code> pre>
I am trying to use file_get_contents
in different way. Somehow it's not working by this way. Please see the code
<?php
$attrb = "https://html5andcss3.org";
$htmlcontent = file_get_contents("'" .$attrb . "'");
echo $htmlcontent;
?>
I got the error message
But when I use this code in normal way, it works fine. Please see the working code below
<?php
$htmlcontent = file_get_contents('https://html5andcss3.org');
echo $htmlcontent;
?>
My problem is that, I will get the URL in a variable and I need to start from there. So I can not directly put the URL.