Answer the question
In order to leave comments, you need to log in
How to configure the parser to unload several numbers from the page?
Good afternoon. There is a parser
<?php
$content = file_get_contents('http://95.31.11.93:82/');
$pos = strpos($content, 'Давление');
$content = substr($content, $pos);
$pos = strpos($content, 'mm');
$content = substr($content, 8, $pos);
echo $content;
?>
748.0mm Влаж
and should display "748.0" Answer the question
In order to leave comments, you need to log in
$data = file_get_contents('http://95.31.11.93:82/');
preg_match('#Давление\s+([\d\.]+)mm#Uis', $data, $out);
echo $out[1];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question