XK8ER
asked on
disable if 75 percent of links are not online
hello there,
I have here $totallinks that holds the number of total links and I also have $alivelinks that hold the total of links that are online..
how can I make an if statement showing a warming like.. "found 75 % of dead links"
I have here $totallinks that holds the number of total links and I also have $alivelinks that hold the total of links that are online..
how can I make an if statement showing a warming like.. "found 75 % of dead links"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
like this
<?php
$totallinks=100;
$alivelinks =20;
$percent = 1-($alivelinks/$totallinks);
if ($percent >= 0.75) {
$percent = sprintf("%.2f",$percent*100);
echo "You have $percent% dead links";
} else {
echo "do nothing";
}
?>
Open in new window