Announcement

Collapse
No announcement yet.

how does % work?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how does % work?

    ive seen it like $i%10 or wotever

    wot function can this be used with?

  • #2
    That's $i modulus 10. It's a math operator that returns the value of $i divided by 10.

    PHP docs: Arithmetic Operators

    Comment


    • #3
      thanks

      Comment


      • #4
        Don't you mean it returns the remainder of $i divided by 10?

        Comment


        • #5
          Yes, it's remainder.

          I blame late night dislexia. =P That stuff is bound to happen when your working at 2AM.

          I NEED SOME SANITY SLEEP!!

          Comment


          • #6
            seen as how we are on the subject of what things mean, what does this do?

            $days = (time()-$user[joindate])/86400;
            $userexp = round(pow(((pow(($user[posts]*2),3))*($days)),0.5));
            $userlevel = 1 + round(pow($userexp,(1 / 3.5)));

            I got this from the hacks forum ages ago and I've been trying to develope and EXP to next level code, but I just can't do it

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...
            X