ich bastel dir grad mal was...
edit: da:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<html>
<body>
<pre>
<?php
$pattern = '/^(.*)\b(\d+)\b(.*)$/';
$subjects = array(
'a:2:{s:11:"autologinid";s:32:"37f8bf33853e0a8c55c5fd2a26f9ffc0";s:6:"use rid";i:3;}',
'a:2:{s:11:"autologinid";s:32:"913dca9aae0fcd681548656c7ed7e7e7";s:6:"use rid";s:1:"342";}'
);
foreach ($subjects as $subject) {
echo "Durchsuche String: $subject\n";
if (preg_match($pattern, $subject, $matches)) {
echo "Zahl gefunden: {$matches[2]}\n";
} else {
echo "Keine Zahl gefunden :´(\n";
}
echo "\n";
// print_r($matches); // einkommentieren für detailansicht der matches
}
?>
</pre>
</body>
</html>
|
viel spaß.