login  Naam:   Wachtwoord: 
Registreer je!
 Forum

arrays

Offline Ultimatum - 02/08/2006 00:43
Avatar van UltimatumPHP expert ik heb op mijn site 1 bestand waar alle zinnen/woorden instaan en nu ben ik bij mijn profiel pagina en heb ik 4 dingen, birthday (staat voor de selectboxen), day, month, year dat heb ik zo neergezet

  1. <?php
  2. $lang['profile']['birthday'] = 'Birthday';
  3. $lang['profile']['birthday']['day'] = 'Day';
  4. $lang['profile']['birthday']['month'] = 'Month';
  5. $lang['profile']['birthday']['year'] = 'Year';
  6. ?>


pagina is beetje lang dus :
http://plaatscode.be/1659/

het probleem is waar ik <?= $lang['profile']['birthday'] ?> heb staan komt nu ipv Birthday => Yirthday

en in mijn selectboxen komt ipv day, month, year => Y te staan 

heb ergens anders ook het 2de woord vaker gebruikt en daar heb ik geen problemen mee gekregen..

snap het niet helemaal meer 

7 antwoorden

Gesponsorde links
Offline Nrzonline - 02/08/2006 00:50 (laatste wijziging 02/08/2006 00:51)
Avatar van Nrzonline PHP ver gevorderde als volgt op te lossen:

  1. <?PHP
  2. $lang['profile']['birthday'] = "birthday";
  3. $lang['profile']['birthday_y'] = "year";
  4. $lang['profile']['birthday_m'] = "month";
  5. $lang['profile']['birthday_d'] = "day";
  6. ?>


Of het anders te voorkomen is weet ik niet, maar dit lost het
probleem in ieder geval wel op.
Offline Ultimatum - 02/08/2006 00:54
Avatar van Ultimatum PHP expert ja maar zo wil ik het niet, ik wil graag hoe ik het had om overzichtelijker te houden

het probleem is waarom werkt dat niet terwijl dit bijvoorbeeld wel weer werkt

  1. <?php
  2. $lang['login']['error']['member'] = 'You are already logged in';
  3. $lang['login']['error']['username'] = 'This username is not correct';
  4. $lang['login']['error']['password'] = 'This password is not correct';
  5. ?>
Offline Nrzonline - 02/08/2006 00:58 (laatste wijziging 02/08/2006 00:59)
Avatar van Nrzonline PHP ver gevorderde ow wacht, dan moet je het zo doen (kom ik net achter)

  1. <?PHP
  2. $_LANG['profile']['birthday']['full'] = "Birthday";
  3. $_LANG['profile']['birthday']['year'] = "Year OK";
  4. $_LANG['profile']['birthday']['month'] = "Month OK";
  5. $_LANG['profile']['birthday']['day'] = "Day OK";
  6. ?>
Offline Ultimatum - 02/08/2006 01:00
Avatar van Ultimatum PHP expert thanks het werkt nu wel, maar waarom...?

waarom niet zonder die ['full'] ? 
Offline Nrzonline - 02/08/2006 01:02
Avatar van Nrzonline PHP ver gevorderde Sry, maar dat zul je aan iemand anders moeten vragen met meer verstand van array's dan mij. (Ik ben ook wel benieuwd)
Offline Maarten - 02/08/2006 02:05
Avatar van Maarten Erelid Analyseer je code:
  1. <?php
  2. $lang['profile']['birthday'] = 'Birthday';
  3. // Je maakt van $lang['profile']['birthday'] een string
  4. $lang['profile']['birthday']['day'] = 'Day';
  5. // Je maakt van $lang['profile']['birthday'] een array, dus is je string weg/overschreven
  6. $lang['profile']['birthday']['month'] = 'Month';
  7. // Je breidt je array $lang['profile']['birthday'] uit met de nieuwe key
  8. $lang['profile']['birthday']['year'] = 'Year';
  9. // Je breidt je array $lang['profile']['birthday'] uit met de nieuwe key
  10. ?>

Is niet meer dan logisch..
Offline Ultimatum - 02/08/2006 09:30 (laatste wijziging 02/08/2006 09:31)
Avatar van Ultimatum PHP expert nee oke, dan is dat ook weer duidelijk bedankt 
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.205s