- var_dump: documentation ( source)
- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?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+)?)\)/', $string, $matches) > 0) {
var_dump($matches[1]);
}
preg_match_all('#([0-9.]+)#is', $string, $matches);
print_r($matches[1]);