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.

Bestimmte Zeichen / Wörter aus einem Text holen ...

Empfohlene Antworten

Veröffentlicht

Hallo zusammen!

Ich habe folgende PHP Frage: ich habe eine Variable wie folgt:

$text="Das ist ein [###BEISPIEL###] und hier ist nochmal ein [###TEST###] und hier vielleicht nochmal [###BLUBB###] und zum Schluss noch einmal ein [###BEISPIEL###].";

Ich möchte nun alle im Text vorkommenden [###?###] in ein Array speichern, inklusive den Klammern und den #-Zeichen.

So dass das Array später so aussieht:

$array[0] = [###BEISPIEL###]

$array[1] = [###TEST###]

$array[2] = [###BLUBB###]

$array[3] = [###BEISPIEL###]

Ich weiss dass das irgendwie mit regular expressions und vielleicht der PHP Funktion "preg_match" funktionieren müsste .... aber wie??? Leider blicke ich bei den regular expressions noch nicht durch :(

Danke vorab herzlichst für eure Hilfe!

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.