如何找到 n 的幂 php 数


How find the n the number of power php

数字幂为2,如下所示:

 2^n = 16

我们如何在 php 中找到n

谢谢

log()接受一个基本参数。

log(16, 2)4.

<?php
 $x = 1024;
 $num = 2;
 $y = log($x, $num);
 echo $y;
?>

给出 y=10