@ 2014-05-05T13:08:59Z <?php
$string = "WALIOFANYA MTIHANI : 70
WASTANI WA SHULE : 138.2571
NAFASI YA SHULE KIWILAYA: 25 kati ya 125
NAFASI YA SHULE KIMKOA : 117 kati ya 571
NAFASI YA SHULE KITAIFA : 1249 kati ya 15656 ";
if (preg_match_all('/\((\d+(?:\.\d+)?)\)/', $str, $matches) > 0) {
var_dump($matches[1]);
}
preg_match_all('#([0-9.]+)#is', $string, $matches);
print_r($matches[1]);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.7 Warning: Undefined variable $str in /in/uG41q on line 9
Deprecated: preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated in /in/uG41q on line 9
Array
(
[0] => 70
[1] => 138.2571
[2] => 25
[3] => 125
[4] => 117
[5] => 571
[6] => 1249
[7] => 15656
)
Output for 8.0.0 - 8.0.30 Warning: Undefined variable $str in /in/uG41q on line 9
Array
(
[0] => 70
[1] => 138.2571
[2] => 25
[3] => 125
[4] => 117
[5] => 571
[6] => 1249
[7] => 15656
)
Output for 5.2.9 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.28 , 7.0.0 - 7.0.20 , 7.1.0 - 7.1.10 , 7.2.0 - 7.2.33 , 7.3.12 - 7.3.31 , 7.4.0 - 7.4.25 , 7.4.27 - 7.4.33 Notice: Undefined variable: str in /in/uG41q on line 9
Array
(
[0] => 70
[1] => 138.2571
[2] => 25
[3] => 125
[4] => 117
[5] => 571
[6] => 1249
[7] => 15656
)
Output for 7.3.32 - 7.3.33 , 7.4.26 Array
(
[0] => 70
[1] => 138.2571
[2] => 25
[3] => 125
[4] => 117
[5] => 571
[6] => 1249
[7] => 15656
)
Output for 4.3.0 Notice: Undefined variable: str in /in/uG41q on line 9
Array
(
[0] => 70
[1] => 138.2571
[2] => 25
[3] => 125
[4] => 117
[5] => 571
[6] => 1249
[7] => 15656
)
preferences:dark mode live preview
199.1 ms | 402 KiB | 312 Q