Problem description: foreach loops the two-dimensional array to find content that meets the conditions and reorganizes it into a new two-dimensional array. The obtained digital string is compared with the number, and the comparison cannot be made. Try to convert the digital characters to int type, and all the results become into 0; (the following code can be run directly)
//创建curl资源 $ch=curl_init(); //设置url和对应项 curl_setopt($ch, CURLOPT_URL, "http://match.sports.sina.com.cn/football/csl/opta_rank.php?item=shoot&year=2014&lid=8&type=1&dpc=1"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //以文件形式返回而不是直接输出 $data=curl_exec($ch); $my_file=fopen("shoot.html",'w') or die('no file'); fwrite($my_file, $data); fclose($my_file); curl_close($ch); $my_file=fopen("shoot.html",'r'); $res= fread($my_file,filesize("shoot.html")); fclose($my_file); //步骤2获取table内容转为数组 $str1 = preg_replace("/]*>/","", $res); $str2 = preg_replace("/<\/a>/","", $str1); preg_match('/
What does it mean not enough beans? The dear friend above, p bean?
333
44444444444444433333333333
Want 1 bean 2 bean 3 bean 0 bean 0 bean - want = bean 43 bean 2 bean 2 bean 4 bean 4 bean
Not enough beans, not enough beans, not enough beans, not enough beans, not enough beans, not enough beans, not enough beans
Not enough beans, not enough beans, not enough beans, not enough beans, not enough beans, not enough beans