做个记录,在工作or面试中有可能会遇到function downImagesFromTargetUrl($url, $target_dir = null) { if(!filter_var($url, FILTER_VALIDATE_URL)){ return false; } if(!$target_dir) { $target_dir = './download'; } $root_url = pathinfo($url); $html = file_get_contents($url);…
一篇文章搞定百度OCR图片文字识别API https://www.jianshu.com/p/7905d3b12104…
我们先来看下默认栏目调用的代码: 复制代码代码如下:{pc:content action="lists" catid="$catid" num="25" order="id DESC" page="$page"}<ul class="list lh24 f14">{loop $data $r}<li><span class="rt">…
{pc:content action="lists" catid="$catid" num="25" order="id DESC" page="$page" moreinfo="1"} <ul class="list lh24 f14"> {loop $data $r} <li><span class="rt">…
<?php $pattern="/<img.*?src=[\'|\"](.*?(?:[\.gif|\.jpg]))[\'|\"].*?[\/]?>/"; $str='<p style="padding: 0px; margin-top: 0px; margin-bottom: 0px; line-height: 200%;"><img border="0" src="../upfi…
文件:/dede/inc/inc_archives_functions.php 代码: preg_match_all("/(src)=[\"|'| ]{0,}([^>]*\.(gif|jpg|bmp|png))/isU",$body,$img_array); 改为 preg_match_all("/(src)=[\"|'| ]{0,}([^>]*\.(gif|jpg|bmp|png|jpeg))/isU",$body,$img_arr…
1.保存canvas中绘制的内容为图片 HTML代码: <canvas id="canvas" width="400" height="400"></canvas> <div> <button id="save">保存</button> </div> js代码: var arr = [ {locations:[[0,0],[200,200],[0,400]…
扒网站当中一般css中的图片扒不下来,这个脚本就是用来下载这些图片到本地的 流程 1.获取css文件路径 2.打开文件逐行读取判断是否包含需要的图片 2.1 包含则 -进行截取直接获取到相对路径 2.1.1 根据curl来文件流,fopne打开文件,fwrite写入文件 2.2不包含则跳出 <?php /** * Created by PhpStorm. * User: 小狗蛋儿 * Date: 2018/3/19 * Time: 14:39 * * 获取css文件下面所有的css文件 * 然后…
Linux 下有很多实用工具可以让你在终端界面查看文本文件.其中一个就是 more. more 跟我之前另一篇文章里写到的工具 —— less 很相似.它们之间的主要不同点在于 more 只允许你向前查看文件. 尽管它能提供的功能看起来很有限,不过它依旧有很多有用的特性值得你去了解.下面让我们来快速浏览一下 more 可以做什么,以及如何使用它吧. 基础使用 假设你现在想在终端查看一个文本文件.只需打开一个终端,进入对应的目录,然后输入以下命令: $ more <filename> 例如, $…