当前位置:网站首页>PHP read file (read the specified line containing a string in the file)
PHP read file (read the specified line containing a string in the file)
2022-07-02 05:49:00 【Jill__ er】
The contents of the document
web=/WmCmUr/WmCmUr?wsdl
audit=/secdit/ws/WmCmUr?wsdl
auth=/app/services/AuthSecService?wsdl
Read with “services” That line , And only take the value after the equal sign
/app/services/AuthSecService?wsdl
Realization way :
<?php
$uriFile = "ConfigFile2.conf";
if(file_exists($uriFile))
{
$lines = @file($uriFile);
foreach($lines as $lineStr)
{
//var_dump($lineStr);
/**string(24) "web=/WmCmUr/WmCmUr?wsdl"
string(29) "audit=/secdit/ws/WmCmUr?wsdl"
string(39) "auth=/app/services/AuthSecService?wsdl" */
if(stripos($lineStr, 'services')!==false)
{
var_dump(trim(explode('=', $lineStr)[1]));
}
}
}
?>
Show results :
[Running] php 2_duwenjian_2.php
string(33) "/app/services/AuthSecService?wsdl"
边栏推荐
- Ubuntu 20.04 installing mysql8
- Thread pool overview
- OLED12864 液晶屏
- php数组转化为xml
- Principle and implementation of parallax effect
- Software testing learning - day 4
- Reflection of the soul of the frame (important knowledge)
- idea开发工具常用的插件合集汇总
- With an amount of $50billion, amd completed the acquisition of Xilinx
- Sliding window on the learning road
猜你喜欢
随机推荐
运动健身的一些心得经验
1037 Magic Coupon
Database batch insert data
vite如何兼容低版本浏览器
软件测试基础篇
Win10 copy files, save files... All need administrator permission, solution
Zzuli:1068 binary number
线程池概述
Basic use of form
centos8安装mysql8.0.22教程
Generate QR code
js判断移动端还是pc端
文件包含漏洞(一)
Gcnet: non - local Networks meet Squeeze excitation Networks and Beyond
MySQL foundation --- query (learn MySQL foundation in 1 day)
软件测试 - 概念篇
Pytorch Basics
KMP idea and template code
Fabric. JS basic brush
Zzuli:1069 learn from classmate Z






![[paper translation] gcnet: non local networks meet squeeze exception networks and beyond](/img/7a/718162d08796f70251511101b3a61b.png)
