当前位置:网站首页>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"
边栏推荐
- centos8安装mysql8.0.22教程
- php继承(extends)
- "Original, excellent and vulgar" in operation and maintenance work
- brew install * 失败,解决方法
- all3dp. All Arduino projects in com website (2022.7.1)
- Typora installation (no need to enter serial number)
- vite如何兼容低版本浏览器
- Technologists talk about open source: This is not just using love to generate electricity
- Financial portal related information
- [leetcode] day92 container with the most water
猜你喜欢

Youth training camp -- database operation project

Centos8 installation mysql8.0.22 tutorial
![[golang syntax] be careful with the copy of slices](/img/5e/1c82c58940939b94d03377ebdc03e3.jpg)
[golang syntax] be careful with the copy of slices

数理统计与机器学习

"Simple" infinite magic cube

Principle and implementation of parallax effect

Record sentry's path of stepping on the pit
![[paper translation] gcnet: non local networks meet squeeze exception networks and beyond](/img/7a/718162d08796f70251511101b3a61b.png)
[paper translation] gcnet: non local networks meet squeeze exception networks and beyond

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

【技术随记-08】
随机推荐
Thread pool overview
kmp思想及模板代码
Zzuli: maximum Convention and minimum common multiple
Grbl software: basic knowledge of simple explanation
Ubuntu 20.04 installing mysql8
Fabric. JS free draw rectangle
File contains vulnerabilities (II)
php读文件(读取文件内含有某字符串的指定行)
php内类名称与类内方法名相同
Applet jumps to official account
Fabric. JS 3 APIs to set canvas width and height
Centos8 installation mysql8.0.22 tutorial
Go language web development is very simple: use templates to separate views from logic
How to change the IP address of computer mobile phone simulator
centos8安裝mysql8.0.22教程
Innovation never stops -- the innovation process of nvisual network visualization platform for Excel import
Financial portal related information
Thunder on the ground! Another domestic 5g chip comes out: surpass Huawei and lead the world in performance?
Zzuli:1064 encrypted characters
1036 Boys vs Girls