PHP3 Und User IP

(Lutz Donnerhacke) lutz at iks-jena.de
Die Feb 22 16:31:57 CET 2000


* bate wrote:

Bitte trage Deinen Namen ein und höre auf volzuquotteln. Das ist ja abstoßend.

>Wenn ich mir die dolle ip an schaue, da stehh dann z.b. 192.168.100.12
>drinne. Ich hätte aber gern die korrekte schrieb weise ala 192.168.100.012
>gibts da sowas wie ne string Formatierung, doer muss ich da wieder ne
>Function basteln die mir da noch ne null vorne hin puttet?

Du willst vorne keine Null haben denn:
  12 = 0xd = 0x0d = 014 = 0014 = 0b1100 = 0b00001100

Oder kurz:
$ perl -e 'print 0192.0169.0100.0012'
Illegal octal digit at -e line 1, at end of line
Illegal octal digit at -e line 1, at end of line
Execution of -e aborted due to compilation errors.