我有一个 PHP 脚本,其中有一个无限循环。浏览器不打印循环中的第一个 echo 语句,它甚至不提供指向超链接的正确链接。可能出了什么问题?
代码:
<html>
<head>
<style>
img{
height:200px;
width:200px;
}
</style>
</head>
<body>
<?php
error_reporting (0);
set_time_limit(0);// Setting an infinite timeout limit.
for($i=1; ;$i++)
{
$to_send = "http://graph.facebook.com/";
$to_send_new = $to_send.$i;
$content = file_get_contents($to_send_new);
$parsed = json_decode($content);
$link = $parsed->link;
$link = str_replace("http://www.facebook.com","https://graph.facebook.com",$link);
$link .="/picture?width=200&height=200";
if(!$parsed->first_name)
goto a;
?>
<br>
First Name: <?php echo $parsed->first_name;?>
<br>
Last Name:<?php echo $parsed->last_name;?>
<br>
Full Name :<?php echo $parsed->name;?>
<br>
Facebook Username:<?php echo $parsed->username;?>
<br>
Gender:<?php echo $parsed->gender;?>
<br>
<a href="<?php echo $link; ?>" target="_blank">Profile Picture</a>
<!--
<img src="<?php/* echo $link; */?>" >
-->
<br>
<hr>
<?php
sleep(5);
a:
}
?>
</body>
</html>