> I am looking for a mod() function in PHP but unfortunately I am unable to
find one.
> Please help...
As in modulus?
if ($foo % 2 == 0) {
// if there's no remainder after dividing by 2
}
if ($foo % 5 != 0) {
// if there is a remainder after dividing by 5
}
HTH
Jon
--
PHP General Mail
I am looking for a mod() function in PHP but unfortunately I am unable to find one.
Please help...
( °> Jim-Christian Flatin
//\\ Skien / Norway
/ \/ ) [EMAIL PROTECTED]
'-<< http://niteshift.d2g.com
> It is an operator in PHP: %
>
> ie. echo 3 % 2;
>
> -Rasmus
>
> On Sat, 8 Sep 2001, Ville Mattila wrote:
Eli jakojäännös (modulo) lasku. PHP:ssä voi tulla ongelmia oikeiden vastausten kanssa,
kun se muuttelee muuttujatyyppiä tarvittaessa. Eli kokonaisluvuista reaaleja jne.
Kannattaa tarkistaa,
It is an operator in PHP: %
ie. echo 3 % 2;
-Rasmus
On Sat, 8 Sep 2001, Ville Mattila wrote:
> Hi folks,
>
> I found this kind of formulae which should calculate the distance between two points
>on earth:
>
> tc1=mod(atan2(sin(lon1-lon2)*cos(lat2),
>cos(lat1)*sin(lat2)-sin(lat1)*c
Hi folks,
I found this kind of formulae which should calculate the distance between two points
on earth:
tc1=mod(atan2(sin(lon1-lon2)*cos(lat2),
cos(lat1)*sin(lat2)-sin(lat1)*cos(lat2)*cos(lon1-lon2)), 2*pi)
This is not PHP code, but now I would need the same formulae in PHP. But I
5 matches
Mail list logo