Answer the question
In order to leave comments, you need to log in
How to round to two decimal places?
require_once 'phpquery.php';
function get_price($url) {
$html = file_get_contents($url);
$doc = phpQuery::newDocument($html);
$price = $doc->find('/* Иду до числа типа float, вот до такого 74,5995*/')->text();
return (float) (round($price, 2));
}
echo get_price(/* Туть юрл */);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question