Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Php Problem - String verarbeitung

Empfohlene Antworten

Hi .

Also folgendes ich habe folgenden String:

diff:1072873193:1072872328:217.5.64.13=3,4c3²< Hier folgt bla.²< Test²\ No newline at end of file²---²> Hier folgt bla2. ²\ No newline at end of file²
Nun kommt folgende Coding:
 

  if (!preg_match("/^diff:(\d+)\d+)\w+)/",$k,$match)) continue;

    $gmt=$match[1];

    $rem_user=$match[3];

[/code]

In gmt steht auch die richtige zeit die er oben auch richtig zerlegt.

Aber in rem_user indem die IP Adresse stehen sollte (217.5.64.13) ist leider immer nur die Adresse bis zum Punkt also sprich 217

Er nimmt nie die volle IP Adresse sondern immer nur bis zum 1. Punkt :/

Woran liegt das ?

Hoffe jemand kann mir helfen :)

mh ich denke mal, dass der "." nicht zu den "words" gezählt wird! (\w)

versuch doch anstatt \w mal: [0-9] {1,3}\.[0-9] {1,3}\.[0-9] {1,3}\.[0-9] {1,3}

Original geschrieben von kills

mh ich denke mal, dass der "." nicht zu den "words" gezählt wird! (\w)

versuch doch anstatt \w mal: [0-9] {1,3}\.[0-9] {1,3}\.[0-9] {1,3}\.[0-9] {1,3}

Hi.

Hat leider nix gebracht :( denn jetzt gibt er gar nichts mehr aus da die preg_match bedingung nicht mehr zutrifft ....

Original geschrieben von jsk

Hi .

Also folgendes ich habe folgenden String:

diff:1072873193:1072872328:217.5.64.13=3,4c3²< Hier folgt bla.²< Test²\ No newline at end of file²---²> Hier folgt bla2. ²\ No newline at end of file²
Nun kommt folgende Coding:
 

  if (!preg_match("/^diff:(\d+)\d+)\w+)/",$k,$match)) continue;

    $gmt=$match[1];

    $rem_user=$match[3];

[/code]

In gmt steht auch die richtige zeit die er oben auch richtig zerlegt.

Aber in rem_user indem die IP Adresse stehen sollte (217.5.64.13) ist leider immer nur die Adresse bis zum Punkt also sprich 217

Er nimmt nie die volle IP Adresse sondern immer nur bis zum 1. Punkt :/

Woran liegt das ?

Hoffe jemand kann mir helfen :) [/b]

Versuchs mal hiermit:

[PHP]
/^diff:(\d+):(\d+):(.+?)=/
[/PHP]

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.