01.
<?php
02.
$str
= <<<ABC
03.
SNMPv2-SMI::enterprises.9.9.46.1.3.1.1.4.1.1 = STRING:
"default"
04.
SNMPv2-SMI::enterprises.9.9.46.1.3.1.1.4.1.10 = STRING:
"Faculty/Staff"
05.
SNMPv2-SMI::enterprises.9.9.46.1.3.1.1.4.1.20 = STRING:
"Students"
06.
SNMPv2-SMI::enterprises.9.9.46.1.3.1.1.4.1.30 = STRING:
"Guest(Default)"
07.
SNMPv2-SMI::enterprises.9.9.46.1.3.1.1.4.1.99 = STRING:
"Management&Native"
08.
SNMPv2-SMI::enterprises.9.9.46.1.3.1.1.4.1.100 = STRING:
"trak"
09.
SNMPv2-SMI::enterprises.9.9.46.1.3.1.1.4.1.120 = STRING:
"sa"
10.
SNMPv2-SMI::enterprises.9.9.46.1.3.1.1.4.1.1002 = STRING:
"fddi-default"
11.
SNMPv2-SMI::enterprises.9.9.46.1.3.1.1.4.1.1003 = STRING:
"token-ring-default"
12.
SNMPv2-SMI::enterprises.9.9.46.1.3.1.1.4.1.1004 = STRING:
"fddinet-default"
13.
SNMPv2-SMI::enterprises.9.9.46.1.3.1.1.4.1.1005 = STRING:
"trnet-default"
14.
SNMPv2-SMI::enterprises.9.9.46.1.2.1.1.2.1 = STRING:
"CCNA3"
15.
ABC;
16.
17.
preg_match_all(
'/\"([^"]*)\"/'
,
$str
,
$found
);
18.
$matches
=
$found
[1];
19.
20.
preg_match_all(
'/1\.([0-9]*)[[:space:]]=/'
,
$str
,
$found1
);
21.
$matches1
=
$found1
[1];
22.
23.
foreach
(
$matches1
as
$num
){
24.
echo
$num
.
'<br />'
;
25.
}
26.
27.
foreach
(
$matches
as
$str
){
28.
echo
$str
.
'<br />'
;
29.
}
30.
?>