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.

Suchen / Ersetzen - kein Plan

Empfohlene Antworten

Veröffentlicht

Hi zusammen,

Ich habe folgendes Problem:

Es gibt einen string

-- text blablabla --

der soll umgewandelt werden in

<b> text blablabla </b>

.

Wie mach ich das am besten und einfachsten??

Danke schon mal für eure Antworten!

Gruß,

Phil

Servus!

schau dir mal die Funktion str_replace an!

viel spaß beim ersetzen ;)

mfg

Azrael

$string = " -- blaalla -- ";

$string = str_replace ( $string, "--", "");

$string = "<b>". $string . "</b>";

Original geschrieben von kills

$string = " -- blaalla -- ";

$string = str_replace ( $string, "--", "");

$string = "<b>". $string . "</b>";

Meiner Meinung nach ist das so nicht richtig.

Sieht der Funktionsaufbau nicht so aus:

mixed str_replace ( mixed search, mixed replace, mixed subject)

also müsste deine zweite Zeile so aussehen:

$string = str_replace("--","",$string);

Ansonsten würde ich das aber genauso machen.

jo hast recht, ich hatte das einfach so ausm kopf raus gemacht ohne in der doku zu schauen.

Danke für die Antworten!

Is ja eigentlich ganz einfach... :-)

Gruß,

PhilSMA

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.