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.

Und schon wieder preg_match!!! -> Zahlen Filter

Empfohlene Antworten

Veröffentlicht

Hi.

Ich hab ein kleines Problem.

Ich habe volgende Beispiel Variable:

$var1 = "Da soll 111 mal 85 einer 667verstehen";

So nun will ich mittels preg_match oder eregi die Zahlen, also hier 111, 85 und 667 aus dem String heraus filtern. :confused:

Wer kann mir dabei helfen? Die Beschreibung auf der php.net Seite versteh ich nicht. Wenn jemand da ein einfacheres Tutorial hat wäre ich sehr dankbar.

Danke schon mal und frohes Fest...


<?
$var1 = "Da soll 111 mal 85 einer 667verstehen";
$nums = array();
preg_match_all("/[0-9]+/",$var1,$nums);
var_dump($nums);
?>
[/php]

[code] array(1) { [0]=> array(3) { [0]=> string(3) "111" [1]=> string(2) "85" [2]=> string(3) "667" } } [/code]

Hey. Wunderbar. Danke. Hat Suppi geklappt.

Ich bin leider nicht selber auf die Idee gekommen preg_match_all zu benutzen... Ich hab versucht da irgendwie ne regel aufzustellen für: "Finde Zahl zwischen Buchstaben".

Warum einfach wenns auch schwer geht :D

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.