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.

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe da ein kleines Problem bei meiner Array-Ausgabe.

Vielleicht könnte mir da einer kurz helfen?

Undzwar habe ich zwei Arrays mit unterschiedlich vielen Keys.

Nun möchte ich aber, dass die Keys vom 2.Array mit den Werten vom 1. Array überschrieben werden.

Er macht es zwar, aber immer nur bei dem nächsten Key und speichert den alten Wert nicht.

Momentane Ausgabe:

02 03 04 05 06 11 12 13 01 07 04 05 06 11 12 13 01 03 08 05 06 11 12 13 01 03 04 09 06 11 12 13 01 03 04 05 10 11 12 13

Die Ausgabe sollte jedoch so aussehen => 02 07 08 09 10 11 12 13

Vielen Dank schonmal im Voraus!

Liebe Grüße

$header1 = array (
"Header" => array (
array (
"value" => '02',
),
array (
"value" => '07',
),
array (
"value" => '08',
),
array (
"value" => '09',
),
array (
"value" => '10',
),
),
);
$header2 = array (
"Header" => array (
array(
"value" => '01',
),
array(
"value" => '03',
),
array(
"value" => '04',
),
array(
"value" => '05',
),
array(
"value" => '06',
),
array(
"value" => '11',
),
array(
"value" => '12',
),
array(
"value" => '13',
),
),
);
var_dump($header1['Header'], $header2['Header']);
foreach ($header1['Header'] as $a => $ {
foreach ($header2['Header'] as $k => $v) {
if ($k == $a) {
$v = $b;
echo $v['value'] . ' ';
} else {
echo $v['value'] . ' ';
}
}
}[/PHP]

  • Autor

Danke für die Antwort.

Jedoch gibt er mir trotz des array_merge das falsche aus:

=> 02 07 08 09 10 01 03 04 05 06 11 12 13

Sollten aber so aussehen:

=> 02 07 08 09 10 11 12 13

Gibt es da noch eine Alternative?

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.