Hi laserlight ,
A new problem but same as above now i have to find this number in string
Viewing 1 to 40 of 223
in this finding in need 223 here
'Viewing' ,' to' and 'of' is fixed and '1', '40' and '223' are variables and always in number.
i try to do this like
$str = '</td><td></td><td>
Viewing 1 to 40 of 223
</td><td><td>
<a title="View reports by Razul" href="/browse/editor/razul/">Razul</a>
<a href="/browse/post/1101493/">Record Of Lodoss Original (FLAC)</a>
</td><td>
Viewing 1 to 12 of 40
</td>';
//Viewing 1 to 40 of 223
$pattern = '/Viewing [0-9] to [0-9] of (.*?)/';
if (preg_match_all($pattern, $str, $matches)) {
foreach ($matches[1] as $match) {
echo $match . '<br>';
}
}
but it giving me nothing. i think problem is in this line
$pattern = '/Viewing [0-9] to [0-9] of (.*?)/';
Also 223 i need like a number cos i have to use it like a number.
Thanks.