php方便 iconFont打包

WBOY
Release: 2016-06-20 12:29:06
Original
956 people have browsed it

直接上效果图:

上代码

<?php header("Content-type:text/html;charset=utf-8");  ?><html><title>iconfont tools</title><h1>赵大财专版released1.0 翻版不纠 2016.5.11</h1><form action="res.php" method="post">   <textarea rows="10" cols="50" name="css">      http://at.alicdn.com/t/font_1462962687_6478822.css   </textarea>    <br>    <input type="submit" value="获取" /></form></html>
Copy after login
<?php/** * Created by PhpStorm. * User: point * Date: 16/5/11 * Time: 下午6:57 */set_time_limit(1800) ;//读取网页内容//$data = file_get_contents($_POST["css"]);$curl = curl_init();curl_setopt($curl, CURLOPT_URL, trim($_POST["css"]));curl_setopt($curl, CURLOPT_HEADER, 1);curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);$data = curl_exec($curl)."<hr><hr><hr><hr><hr><hr>";curl_close($curl);//.icon-loginagreen:beforepreg_match_all("/.icon-(.*):before/sU",$data,$title);preg_match_all("/{ content: (.*); }/sU",$data,$haha);$arr =(explode(" ",$title[1]));$i=0;foreach($title[1] as $v){    echo "static NSString *kIcon_".$v."=@".$haha[1][$i].";"."<br>";    $i++;}
Copy after login

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template