1. require('xfm_simple_cache.v.2.php'); - 引入xfm_simple_cache.v.2.php文件
  2. require_once('3rd/phpQuery.php'); - 引入phpQuery库
  3. $keyword = isset($_GET['kw'])?$_GET['kw']:''; - 获取GET请求参数kw的值,如果不存在则将$keyword赋值为空字符串
  4. if ($keyword !== '') { - 判断$keyword是否为空
  5. $pn = '1'; - 将$pn赋值为字符串'1'
  6. $s = $keyword; - 将$s赋值为$keyword的值
  7. $ttt = explode(',', $s); - 使用逗号将$s拆分为数组$ttt
  8. $s = $ttt[0]; - 将$s赋值为数组$ttt的第一个元素
  9. $xfm_cache = xfm_get_cache_img($s); - 调用xfm_get_cache_img函数获取$s对应的缓存图片URL,并将结果赋值给$xfm_cache
  10. if ($xfm_cache !== '') { - 判断$xfm_cache是否为空
  11. $img_url = $xfm_cache; - 将$img_url赋值为$xfm_cache的值
  12. header("Location: ".$img_url); - 发送一个HTTP重定向响应头,将浏览器重定向到$img_url指定的URL
  13. exit; - 终止脚本的执行
  14. else { - 如果$xfm_cache为空
  15. $img_arr = get_article_v1($s, $pn); - 调用get_article_v1函数获取关键字$s对应的文章图片URL数组,并将结果赋值给$img_arr
  16. if (count($img_arr)>0) { - 判断$img_arr的元素个数是否大于0
  17. $img_url = $img_arr[0]; - 将$img_url赋值为$img_arr的第一个元素
  18. header("Location: ".$img_url); - 发送一个HTTP重定向响应头,将浏览器重定向到$img_url指定的URL
  19. xfm_put_cache($s, $img_arr[0]); - 调用xfm_put_cache函数将$s和$img_arr的第一个元素作为参数,将$s对应的缓存图片URL存储起来
  20. }
  21. else { - 如果$img_arr的元素个数不大于0
  22. header('location: '.'https://img2.baidu.com/it/u=3862871684,2562239546&fm=253&fmt=auto&app=138&f=JPEG?w=440&h=317'); - 发送一个HTTP重定向响应头,将浏览器重定向到指定的URL
  23. exit; - 终止脚本的执行
  24. }
  25. }
  26. exit; - 终止脚本的执
requirexfm_simple_cachev2php;#echo nice_baidu_get百度 1;require_once3rdphpQueryphp;$keyword = isset$_GETkw$_GETkw;if $keyword !== headerlocation httpcdnqianchusaicomimgurlencode$keywordjpg; exit

原文地址: https://www.cveoy.top/t/topic/hFv9 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录