当前位置:网站首页>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"
边栏推荐
- GRBL 软件:简单解释的基础知识
- Fabric. JS three methods of changing pictures (including changing pictures in the group and caching)
- "Original, excellent and vulgar" in operation and maintenance work
- Innovation never stops -- the innovation process of nvisual network visualization platform for Excel import
- Opencv LBP features
- php按照指定字符,获取字符串中的部分值,并重组剩余字符串为新的数组
- [golang syntax] be careful with the copy of slices
- 3D printer G code command: complete list and tutorial
- Get the details of the next largest number
- Fabric. JS iText set italics manually
猜你喜欢

【pyinstaller】_ get_ sysconfigdata_ name() missing 1 required positional argument: ‘check_ exists‘
![[technical notes-08]](/img/52/0aff21b01ba7adbfcdb597d1aa85f9.png)
[technical notes-08]

2022-2-14 learning xiangniuke project - section 23, section 5, development login and exit functions

“簡單”的無限魔方

Fabric. JS compact JSON

Pytorch Basics

Basic use of form

《CGNF: CONDITIONAL GRAPH NEURAL FIELDS》阅读笔记

File contains vulnerabilities (II)

File contains vulnerability (I)
随机推荐
Reflection of the soul of the frame (important knowledge)
Zzuli:1060 numbers in reverse order
php内类名称与类内方法名相同
Fabric. JS gradient
RNN recurrent neural network
Get the details of the next largest number
centos8安装mysql8.0.22教程
Fabric. JS iText set italics manually
3D printer G code command: complete list and tutorial
MySQL foundation --- query (learn MySQL foundation in 1 day)
在线音乐播放器app
php读文件(读取文件内含有某字符串的指定行)
青训营--数据库实操项目
死磕大屏UI,FineReport开发日记
GRBL 软件:简单解释的基础知识
h5跳小程序
[technical notes-08]
【論文翻譯】GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond
Practice C language advanced address book design
2022-2-14 learning xiangniuke project - Section 6 displays login information