PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Shendemiar
Forum Contributor
Posts: 404 Joined: Thu Jan 08, 2004 8:28 am
Post
by Shendemiar » Sat Jan 17, 2004 1:00 pm
Whats wrong?
Code: Select all
if ($i / 2)
{
$A="REM=0";
}
else
{
$A="NOT dividable";
}
Last edited by
Shendemiar on Sat Jan 17, 2004 1:15 pm, edited 1 time in total.
phpcoder
Forum Contributor
Posts: 158 Joined: Sat Nov 02, 2002 1:18 pm
Location: Manchester, UK
Post
by phpcoder » Sat Jan 17, 2004 1:04 pm
What error u r getting ?
Shendemiar
Forum Contributor
Posts: 404 Joined: Thu Jan 08, 2004 8:28 am
Post
by Shendemiar » Sat Jan 17, 2004 1:05 pm
Never mind, im too tired.
I used $i insted of $j
Gen-ik
DevNet Resident
Posts: 1059 Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.
Post
by Gen-ik » Sat Jan 17, 2004 1:05 pm
Try...
Code: Select all
<?php
if (is_int($i))
{
$A="REM=0";
}
else
{
$A="NOT dividable";
}
?>
Shendemiar
Forum Contributor
Posts: 404 Joined: Thu Jan 08, 2004 8:28 am
Post
by Shendemiar » Sat Jan 17, 2004 1:11 pm
Sorry about that
Anyway i found out that / returns float, and is_int is handy so it didnt go in vain...