Skip to content
View in the app

A better way to browse. Learn more.

GTAGames.nl - De Nederlandse Grand Theft Auto Community!

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.

php - hulp?

ik heb nu dit:

for ($i=0;$i<=$countmeubels;$i++){
echo "<img src='webitems/meubels/$meubels[$i].png'>";
if ($i == "8"){
echo "<br>";
}
else if ($i == "16"){
echo "<br>";
}
}

Maar, ik wil gewoon dat er om de 8 keer een <br> bij word gezet, hoe ik het nu heb gedaan doet hij dat bij 8 en 16.

maar over een paar weken zullen sommige mensen wel 50 stuks hebben. is er een manier om automatisch om de 8 loops een <br> bij te zetten?

Featured Replies

Niet getest.

for ($i=0; $i<=$countmeubels; $i++){
$x = $i % 8; // Als het deelbaar is door 8 is $x 0, anders 1-7.
echo "<img src='webitems/meubels/$meubels[$i].png'>";
if ($x == "0"){
echo "<br>";
}
}

Nu controleert PHP of $i deelbaar is door 8. Zo ja (wanneer $x 0 is), zet dan een enter, anders niet.

Er is nog een mogelijk probleem: Als hij 0 is maakt hij ook een enter, dat is simpel te verhelpen door erbij te controleren of $i niet 0 is:

if ($x == "0" && $i != "0") {

Edit: @Hieronder: Je moet er toch achter komen of het deelbaar is door 8. Dat gaat goed met de modulus (%) operator.

Edited by Donald F. Duck

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

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.