当前位置:网站首页>php读文件(读取文件内含有某字符串的指定行)
php读文件(读取文件内含有某字符串的指定行)
2022-07-02 05:47:00 【杰儿__er】
文件内容
web=/WmCmUr/WmCmUr?wsdl
audit=/secdit/ws/WmCmUr?wsdl
auth=/app/services/AuthSecService?wsdl
读取含“services”的那一行,且只取等号后的值
/app/services/AuthSecService?wsdl
实现方式:
<?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]));
}
}
}
?>
显示结果:
[Running] php 2_duwenjian_2.php
string(33) "/app/services/AuthSecService?wsdl"
边栏推荐
- 1036 Boys vs Girls
- GRBL 软件:简单解释的基础知识
- Gee series: unit 9 generate sampling data in GEE [random sampling]
- Simply encapsulate JS and apply it
- The Hong Kong Stock Exchange learned from US stocks and pushed spac: the follow-up of many PE companies could not hide the embarrassment of the world's worst stock market
- 《CGNF: CONDITIONAL GRAPH NEURAL FIELDS》阅读笔记
- Usage record of vector
- idea开发工具常用的插件合集汇总
- Financial portal related information
- RNN recurrent neural network
猜你喜欢

Record sentry's path of stepping on the pit

【论文翻译】GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond
![[technical notes-08]](/img/52/0aff21b01ba7adbfcdb597d1aa85f9.png)
[technical notes-08]

7. Eleven state sets of TCP

Fabric. JS activation input box
![Gee series: unit 9 generate sampling data in GEE [random sampling]](/img/ff/edb27b40f63eca81c5683e81b2860b.jpg)
Gee series: unit 9 generate sampling data in GEE [random sampling]

brew install * 失败,解决方法

Installation du tutoriel MySQL 8.0.22 par centos8

Principle and implementation of parallax effect

Résumé de la collection de plug - ins couramment utilisée dans les outils de développement idea
随机推荐
JVM class loading mechanism
软件测试 - 概念篇
Zzuli:1061 sequential output of digits
生成二维码
Straighten elements (with transition animation)
Appnuim environment configuration and basic knowledge
Importation de studio visuel
Determine whether there is an element in the string type
[personal test] copy and paste code between VirtualBox virtual machine and local
Operator details
Cube magique infini "simple"
"Simple" infinite magic cube
线程池概述
RGB 无限立方体(高级版)
Ls1046nfs mount file system
Taskbar explicit / implicit toggle function
Generate QR code
Fabric. JS right click menu
h5跳小程序
XSS basic content learning (continuous update)