日期:2014-05-17  浏览次数:20453 次

php中关于“红点”的问题。。。
为什么下面的红点必须叫上才能显示出$arr[2][$id]中的内容呢?很困惑
<?php
 include_once("conn.php");

  if($_GET[id]<=60){
  $con=file_get_contents("http://it.sohu.com/7/1002/17/column203661721_32".$_GET[id].".shtml");
  $preg = "#<h1>·<a href='(.*)' target='_blank'>(.*)</a><span>#iUs";
  preg_match_all($preg,$con,$arr);
  foreach($arr[1] as $id=>$v){
------------------------

$sql="INSERT INTO `tmp_url` (`id`, `title`, `url`) VALUES (NULL, '".$arr[2][$id]
."', '".$v."');";
 
---------------------

mysql_query($sql);

  
  }
  $_GET[id]++;
  echo "<script>location.href='ls.php?id=".$_GET[id]."'</script>";
  }
?>



------解决方案--------------------
探讨
为什么下面的红点必须叫上才能显示出$arr[2][$id]中的内容呢?很困惑
<?php
include_once("conn.php");

if($_GET[id]<=60){
$con=file_get_contents("http://it.sohu.com/7/1002/17/column203661721_32".$_GET[id].".shtml");
$p……

------解决方案--------------------
这红点等于是字符串连接符
------解决方案--------------------
红点把字符串连接了,$sum = "abc"."ef";
则$sum = "abcdef";
------解决方案--------------------
$sql="INSERT INTO `tmp_url` (`id`, `title`, `url`) VALUES (NULL, '{$arr[2][$id]}', '".$v."');";