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.

nl2br() macht schlontz, aber warum?!?

Empfohlene Antworten

Hola!

Ich habe auf einer Kiste mit php-4.0.5 das

Problem, dass bei einem nl2br() aus den \n's kein <br>, sondern ein <br \> gemacht wird.

In den Variablen, die ich durch die Funktion jag, sind keine zuescapenden Zeichen die die Funktion stoeren koennten.

Aber eigentlich ist es egal, ob ich vorher ein addshlashes() mach, oder nich, das Ergebnis ist immer das selbe. :confused:

Hat jemand ne Ahnung, warum?

Is des etvl. n Bug ind er PHP-Version?.

So long.

warum so kompliziert?!?

<pre>

$text=str_replace("\n","<br>",$text);

</pre>

das funzt!

mfg andi

das weiss ich auch, aber wenn es schon eine implementierte funktion gibt, dann wuerd ich die gerne nutzen :).

ich hab's behelfsweise schon auf str_replace() umgebaut, aber besonders "sauber" is des IMHO nich.

also nachgeforscht und schlau geworden...

http://www.php.net/manual/de/function.nl2br.php

schau da, und du wirst zur erkenntnis kommen, dass dieses komische < br / > ein xhtml tag ist und ab version 4.0.5 benutzt wird.

Interessant sind hierbei die weiter untenstehenden Kommentare *fg*.

aber mach dich schlau...!!!

mfg andi

na da ham'se ja ma wieder was dolles gemacht. *yax*

nuja, dann inzukunft halt doch str_replace() :).

So long.

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.