Jump to content

Fligex

New Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Fligex's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the extra info ignace, I had guessed self was referencing the current class some how but I'm curious what it is actually doing.. "granted I know this syntax is wrong" but I imagine its something like this: function add(new thisClass($b)) Is that an accurate depiction of what is happening? Btw I didn't end up using the keyword since I wasn't sure what it was doing and I wanted to include more parameters.
  2. Hi, thanks for reply. What is the keyword "self" doing? First time I've seen it.
  3. I am curious as to how one might go about overloading the Arithmetic Operators for a class. I have a class in which I find myself in need of doing this. Any ideas? Thanks.
  4. I took the liberty to write out a script to perform the task stated by the OP... I don't have time to fin it atm but you can take a look and get an idea of how i'm doing it, possibly help you.. I'll try to finish it after my next class. <?php ///////////////////////////////////////// ///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/// ///^^ Calculate Ip Range difference ^^/// ///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/// ///////////////////////////////////////// //Example (192.168.11.10) - (192.168.10.1) = 268 Addresses //////////////////////////////// //### START AND END IP #s ###/// //////////////////////////////// $Start = explode('.','192.168.10.1'); $End = explode('.','192.168.11.10); $Part =; //////////////////////////////////////////////////// //### Initiate Place holder for generated IP's ###// //////////////////////////////////////////////////// $GendIP = Array(); /////////////////////////////// //### Min/Max IP # Ranges ###// /////////////////////////////// $Max = 255; $Min = 0; $Cap = Array(); $NumIP = 0; ////////////////////////// //### How Many IP's? ###// ////////////////////////// for($i=0; $i<4; $i++) { //First check if the IP segments match //as then there is not calc to be done if($Start[$i] == $End[$i]) { //The first segment of the two IP's given match //So there is nothing to be done. //Set cap place holder $Cap[$i] = nil; } else { //The IP segments don't match so we will find a //range cap for this segment $Cap[$i] = $End[$i] - $Start[$i]; } if($Cap[$i] != 'nil') { $NumIP += $Cap[$i] } } //Gen the Ip's for($i=0; $i<=$NumIP; $i++) { } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.