PHP采用正则表达式提取四列数据存成数组将数据批量导入mysql数据库中
PHPz
PHPz 2017-04-10 14:29:12
0
2
729

PHP采用正则表达式提取四列数据,存成数组,将数据批量导入mysql数据库中

>>>>[0601_Access_S5352]dis arp
>>>>IP ADDRESS      MAC ADDRESS  EXPIRE(M) TYPE INTERFACE      VPN-INSTANCE
>>>>--------------------------------------------------------------------------
>>>>192.168.66.11   0016-413e-0c62         SF-  GE0/0/23                 66
>>>>192.168.66.13   0019-b906-e2ec         S--  GE0/0/18                 66
>>>>192.168.66.15   0019-b906-be56         S--  GE0/0/16                 66
>>>>192.168.66.17   0018-8b1e-96df         SF-  GE0/0/45                 66*

给一段代码吧,想提取ipaddress,macaddress,interface,vpninstance 四段数据

写入mysql数据库,是多行的,

>>>>insert into ip_interface (ipaddress,macaddress,interface,vpn) values ('192.168.66.11','0016-413e-0c62','GE0/0/23','66');*
PHPz
PHPz

学习是最好的投资!

reply all(2)
phpcn_u38476

PHP uses regular expressions to extract four columns of data and save them into arrays to batch import the data into the mysql database


phpcn_u38476

PHP uses regular expression v to extract four columns of data and save them into arrays to batch import the data into the mysql database


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!