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.

Durchlauf...

Empfohlene Antworten

Veröffentlicht

Hallo Leute!

Also ich habe meine PHP-Datei und eine TXT-Datei.

In der TXT-Datei stehen IP`s die durch ein "return / zeilenumbruch getrennt sind" sprich:

192.168.0.1

192.168.0.2

192.168.0.5

192.168.0.6

usw.

Nun ist hab ich ein bestimmten Ablauf in meiner PHP-Datei...

Wie ist es nun möglich der Variable $ip die einzelnen IP`s zuzordnen?!

Also sprich das er mit der ersten IP die PHP-Datei durchgeht und dann mit der zweiten IP es nochmal durchgeht...

Kleines Beispiel zur Verdeutlichung:

PHP-Datei:


<?php
print "$ip is cool\n";
?>
[/PHP]

[b]TXT-Datei:[/b]

192.168.0.1

192.168.0.2

192.168.0.5

192.168.0.6

[b]Ausgabe:[/b]

192.168.0.1 is cool

192.168.0.2 is cool

192.168.0.5 is cool

192.168.0.6 is cool

Dazu brauch ich doch ne While-Schleife oder? Und den Adreßzeiger muss ich immer von einem /n zum nächsten /n springen lassen oder so?!? :marine

hallo,

sollte so gehen


<?php
$file = fopen ("ipadressen.txt", "r");
if (!$file) {
echo "<p>Datei konnte nicht geöffnet werden.\n";
exit;
}
while (!feof ($file)) {
$line = fgets ($file, 1024);
echo $line." ist cool";
}
}
fclose($file);
?>
[/PHP]

so long,

MsB

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.