如何添加变量a的80%(它是一个数值),所以当我回显它时,它会添加百分比回声?
// Include the library
include('simple_html_dom.php');
$html = file_get_html('https://thecurlurl.com/');
// Find the DIV tag with an id of "myId"
foreach($html->find('span#myId') as $a)
// add 80% to variable "a", how ?
echo $a->innertext . '<br>';
echo $a;
答案 0 :(得分:1)
试试这个:
echo round( $a/100 * 180 );
答案 1 :(得分:0)
如评论中所述:
echo floatval($a->innertext) * 1.8;