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.

SetAt in PHP

Empfohlene Antworten

Veröffentlicht

Hallo!

Ich suche ein Pendant zu der CString Funktion 'SetAt' in PHP. Gibt es sowas?

Hier die Beschreibung des CString SetAt:

CString::SetAt
This method overwrites a single character specified by an index number.
SetAt will not enlarge the string if the index exceeds the bounds of the
existing string.

void SetAt(
int nIndex,
TCHAR ch );
Parameters
nIndex
Specifies the zero-based index of the character in the CString object.
The nIndex parameter must be greater than or equal to 0 and less than the
value returned by GetLength. The Debug version of the Microsoft Foundation
Class Library validates the bounds of nIndex; the Release version does not.
ch
Specifies the character to insert. [/php]

Bine

string substr_replace (string string, string replacement, int start [, int length])

Hallo Woodstock!

In PHP (genau wie in C) sind Strings nichts anderes als Zeichenarrays, daher kannst du einfach mit $text[4] z.B. auf das fünfte Zeichen (Index beginnt mit null!) zugreifen.

So einfach ist das leider nicht. Ich habe Funktionen die teilweise rekursiv sind - und da ist das schon ein wenig komplizierter. Aber die Funktion die ulluoink mir genannt hat funktioniert einwandfrei. Programm ist so gut wie fertig - ich mache nur noch die Feinheiten!

Bine

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.