当前位置:网站首页>php提取txt文本存储json数据中的域名
php提取txt文本存储json数据中的域名
2022-06-26 08:50:00 【因起名而头秃】
目的:提取爱名网、腾讯、阿里等域名售卖列表域名信息
php代码
<?php
$file_path = "ym.txt";//文件路径
if(file_exists($file_path)){
$str = file_get_contents($file_path);//将整个文件内容读入到一个字符串中
$str=iconv("GBK","UTF-8",$str);//中文乱码
$arr = json_decode($str,true);//将字符串格式json转成数组
//展示数组数据
//echo "<pre>";
//print_r($arr);
//echo "</pre>";
foreach($arr as $v){
echo $v['Domain'];//提取的key
echo "<br>";
}
}else{
echo '文件不存在';
}
文本格式
[
{
"IsSyncTui": 1,
"BPrice": 0,
"PackageId": -1,
"Url": "/ykj/chujia_30364309.html",
"IsIdn": false,
"CurBidders": "无",
"Lefttime": "10天10时",
"Domain": "1L6.cn",
"OriginalPrice": 40,
"BidCount": "0",
"MinPrice": "¥40",
"IsDaiGuan": 0,
"Domains": "1L6.cn",
"IsTG": 0,
"IsGq": 0,
"RexpireDate": "11天",
"cxImgUrl": "",
"avgPrice": "¥40",
"timered": "",
"Id": 30364309,
"Currentpri": "¥0",
"EndTime": "2022-06-23T20:02:14",
"Registrar": "爱名网",
"DetailsType": 2,
"IsBegin": 1,
"Type": "一口价",
"Introduce": "一千 不讲价",
"Clicks": 92,
"TradeType": 2,
"Platform": "",
"RegisterDate": "2021-06-24"
},
{
"IsSyncTui": 1,
"BPrice": 0,
"PackageId": -1,
"Url": "/ykj/chujia_29112996.html",
"IsIdn": false,
"CurBidders": "无",
"Lefttime": "26天19时",
"Domain": "o9b.cn",
"OriginalPrice": 55,
"BidCount": "0",
"MinPrice": "¥55",
"IsDaiGuan": 0,
"Domains": "o9b.cn",
"IsTG": 0,
"IsGq": 0,
"RexpireDate": "27天",
"cxImgUrl": "",
"avgPrice": "¥55",
"timered": "",
"Id": 29112996,
"Currentpri": "¥0",
"EndTime": "2022-07-10T04:06:42",
"Registrar": "爱名网",
"DetailsType": 2,
"IsBegin": 1,
"Type": "一口价",
"Introduce": "更多域名访问93mk.com",
"Clicks": 263,
"TradeType": 2,
"Platform": "",
"RegisterDate": "2021-07-11"
}
]
输出
边栏推荐
- Phpcms V9 background article list adds one click push to Baidu function
- ImportError: ERROR: recursion is detected during loading of “cv2“ binary extensions. Check OpenCV in
- 《一周搞定模电》—55定时器
- dedecms小程序插件正式上线,一键安装无需任何php或sql基础
- 挖财打新债安全吗
- 【C】青蛙跳台阶和汉诺塔问题(递归)
- Nacos注册表结构和海量服务注册与并发读写原理 源码分析
- phpcms v9后台文章列表增加一键推送到百度功能
- 《一周搞定数电》——编码器和译码器
- Phpcms V9 mall module (fix the Alipay interface Bug)
猜你喜欢

Yolov5 advanced 5 GPU environment setup

《一周搞定数电》——编码器和译码器

《一周搞定模电》—电源电路

Detectron2 outputs validation loss during training

PD fast magnetization mobile power supply scheme

51单片机ROM和RAM

Srv6---is-is extension

Yolov5 advanced zero environment rapid creation and testing

Edit type information

phpcms v9去掉phpsso模块
随机推荐
Master data management of scientific research institutes? Suppliers or customers? I am a correspondent
Analysis of ROS calculation diagram level
《一周搞定数电》——编码器和译码器
Graduation thesis management system based on SSM
《一周搞定模电》—电源电路
Practice of production control | dilemma on assembly rack
挖财打新债安全吗
[program compilation and pretreatment]
[300+ continuous sharing of selected interview questions from large manufacturers] column on interview questions of big data operation and maintenance (I)
Detectron2 draw confusion matrix, PR curve and confidence curve
Phpcms V9 mobile phone access computer station one-to-one jump to the corresponding mobile phone station page plug-in
【开源】使用PhenoCV-WeedCam进行更智能、更精确的杂草管理
Principle and application of single chip microcomputer -- Overview
Self taught neural network series - 1 Basic programming knowledge
Jetson TX2 installing the SciPy Library
51 single chip microcomputer ROM and ram
Uniapp uses uparse to parse the content of the background rich text editor and modify the uparse style
Data warehouse (1) what is data warehouse and what are the characteristics of data warehouse
Load other related resources or configurations (promise application of the applet) before loading the homepage of the applet
commonJS和ES6模块化的区别