首页  >  文章  >  后端开发  >  php中关于“红点”的有关问题。

php中关于“红点”的有关问题。

WBOY
WBOY原创
2016-06-13 13:34:42796浏览

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

  if($_GET[id]   $con=file_get_contents("http://it.sohu.com/7/1002/17/column203661721_32".$_GET[id].".shtml");
  $preg = "#

·(.*)#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]中的内容呢?很困惑
include_once("conn.php");

if($_GET[id] $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."');";

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn