View Single Post
Old 05-14-2008, 04:35 PM   #4 (permalink)
Nor
The Addict
 
Join Date: Nov 2007
Posts: 282
Thanks: 61
Nor is on a distinguished road
Default

I'm not trying to do nothing atm as I did it.

And yes I was doing that but in a different/shorter way

I had a table with 4 columns and I had 9 results that had to fit in the table, SO I made this function to tell me how many columns are needed to make a complete 4 by # without leaving off a couple columns to make my table not be incomplete.

And my function is shorter then using that code multiple times(repeated code) since I need this function 3 times in a class I'm creating for different table column sizes:

PHP Code:
function number_divisibility($num1,$num2)
{
    if(
$num1 $num2 == 0) return 0;
    return 
$num2 - ($num1 $num2);

So you might get the point of this function and I'm not asking for help, but letting other people get help from many people might need to use this at some point in PHP.
__________________
PHP/XHTML Freelancer:
Cleanscript.com v3 - Programming starting at just $5 act now!
Nor is offline  
Reply With Quote