0
multidimensional arrays in PHP
LEGEND
,
/t5/dreamweaver-discussions/multidimensional-arrays-in-php/td-p/789452
Apr 22, 2006
Apr 22, 2006
Copy link to clipboard
Copied
How can I do an array assignment like this -
$variable[1,1]='foo';
???
I want to have multiple sets of prompts, allowing multi-language pages,
e.g.,
$prompt[1,1] = 'hello';
$prompt[2,1]='ola';
etc.
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
$variable[1,1]='foo';
???
I want to have multiple sets of prompts, allowing multi-language pages,
e.g.,
$prompt[1,1] = 'hello';
$prompt[2,1]='ola';
etc.
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Newsgroup_User
AUTHOR
LEGEND
,
/t5/dreamweaver-discussions/multidimensional-arrays-in-php/m-p/789453#M152721
Apr 22, 2006
Apr 22, 2006
Copy link to clipboard
Copied
.oO(Murray *ACE*)
>How can I do an array assignment like this -
>
>$variable[1,1]='foo';
$variable[1][1] = 'foo';
>I want to have multiple sets of prompts, allowing multi-language pages,
>e.g.,
>
>$prompt[1,1] = 'hello';
>$prompt[2,1]='ola';
For such things I use language codes instead of just numbers:
$prompt['de-DE'][1] = 'hallo';
$prompt['en-GB'][1] = 'hello';
$prompt['es-ES'][1] = 'ola';
Or vice versa:
$prompt[1]['de-DE'] = 'hallo';
$prompt[1]['en-GB'] = 'hello';
$prompt[1]['es-ES'] = 'ola';
Other syntax:
$prompt[1] = array(
'de-DE' => 'hallo',
'en-GB' => 'hello',
'es-ES' => 'ola'
);
In my scripts the current page language is stored in a variable $lang
for example, which can then also be used for the 'html' element:
<html lang="<?php print $lang?>">
Just an idea.
I also recommend to have a look at the gettext extension, which can make
localization and i18n much easier:
http://www.php.net/manual/en/ref.gettext.php
Micha
>How can I do an array assignment like this -
>
>$variable[1,1]='foo';
$variable[1][1] = 'foo';
>I want to have multiple sets of prompts, allowing multi-language pages,
>e.g.,
>
>$prompt[1,1] = 'hello';
>$prompt[2,1]='ola';
For such things I use language codes instead of just numbers:
$prompt['de-DE'][1] = 'hallo';
$prompt['en-GB'][1] = 'hello';
$prompt['es-ES'][1] = 'ola';
Or vice versa:
$prompt[1]['de-DE'] = 'hallo';
$prompt[1]['en-GB'] = 'hello';
$prompt[1]['es-ES'] = 'ola';
Other syntax:
$prompt[1] = array(
'de-DE' => 'hallo',
'en-GB' => 'hello',
'es-ES' => 'ola'
);
In my scripts the current page language is stored in a variable $lang
for example, which can then also be used for the 'html' element:
<html lang="<?php print $lang?>">
Just an idea.
I also recommend to have a look at the gettext extension, which can make
localization and i18n much easier:
http://www.php.net/manual/en/ref.gettext.php
Micha
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Newsgroup_User
AUTHOR
LEGEND
,
/t5/dreamweaver-discussions/multidimensional-arrays-in-php/m-p/789454#M152722
Apr 22, 2006
Apr 22, 2006
Copy link to clipboard
Copied
Awesome - that's what I wanted, Micha! Thanks....
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Michael Fesser" <netizen@gmx.de> wrote in message
news:lu8k42t9mdo9fgrf6n036ics888poeu1jr@4ax.com...
> .oO(Murray *ACE*)
>
>>How can I do an array assignment like this -
>>
>>$variable[1,1]='foo';
>
> $variable[1][1] = 'foo';
>
>>I want to have multiple sets of prompts, allowing multi-language pages,
>>e.g.,
>>
>>$prompt[1,1] = 'hello';
>>$prompt[2,1]='ola';
>
> For such things I use language codes instead of just numbers:
>
> $prompt['de-DE'][1] = 'hallo';
> $prompt['en-GB'][1] = 'hello';
> $prompt['es-ES'][1] = 'ola';
>
> Or vice versa:
>
> $prompt[1]['de-DE'] = 'hallo';
> $prompt[1]['en-GB'] = 'hello';
> $prompt[1]['es-ES'] = 'ola';
>
> Other syntax:
>
> $prompt[1] = array(
> 'de-DE' => 'hallo',
> 'en-GB' => 'hello',
> 'es-ES' => 'ola'
> );
>
> In my scripts the current page language is stored in a variable $lang
> for example, which can then also be used for the 'html' element:
>
> <html lang="<?php print $lang?>">
>
> Just an idea.
>
> I also recommend to have a look at the gettext extension, which can make
> localization and i18n much easier:
>
> http://www.php.net/manual/en/ref.gettext.php
>
> Micha
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Michael Fesser" <netizen@gmx.de> wrote in message
news:lu8k42t9mdo9fgrf6n036ics888poeu1jr@4ax.com...
> .oO(Murray *ACE*)
>
>>How can I do an array assignment like this -
>>
>>$variable[1,1]='foo';
>
> $variable[1][1] = 'foo';
>
>>I want to have multiple sets of prompts, allowing multi-language pages,
>>e.g.,
>>
>>$prompt[1,1] = 'hello';
>>$prompt[2,1]='ola';
>
> For such things I use language codes instead of just numbers:
>
> $prompt['de-DE'][1] = 'hallo';
> $prompt['en-GB'][1] = 'hello';
> $prompt['es-ES'][1] = 'ola';
>
> Or vice versa:
>
> $prompt[1]['de-DE'] = 'hallo';
> $prompt[1]['en-GB'] = 'hello';
> $prompt[1]['es-ES'] = 'ola';
>
> Other syntax:
>
> $prompt[1] = array(
> 'de-DE' => 'hallo',
> 'en-GB' => 'hello',
> 'es-ES' => 'ola'
> );
>
> In my scripts the current page language is stored in a variable $lang
> for example, which can then also be used for the 'html' element:
>
> <html lang="<?php print $lang?>">
>
> Just an idea.
>
> I also recommend to have a look at the gettext extension, which can make
> localization and i18n much easier:
>
> http://www.php.net/manual/en/ref.gettext.php
>
> Micha
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Newsgroup_User
AUTHOR
LEGEND
,
LATEST
/t5/dreamweaver-discussions/multidimensional-arrays-in-php/m-p/789455#M152723
Apr 27, 2006
Apr 27, 2006
Copy link to clipboard
Copied
Micha:
Without that gettext addon, how can I parse the language from a page to
determine which prompts to use?
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Michael Fesser" <netizen@gmx.de> wrote in message
news:lu8k42t9mdo9fgrf6n036ics888poeu1jr@4ax.com...
> .oO(Murray *ACE*)
>
>>How can I do an array assignment like this -
>>
>>$variable[1,1]='foo';
>
> $variable[1][1] = 'foo';
>
>>I want to have multiple sets of prompts, allowing multi-language pages,
>>e.g.,
>>
>>$prompt[1,1] = 'hello';
>>$prompt[2,1]='ola';
>
> For such things I use language codes instead of just numbers:
>
> $prompt['de-DE'][1] = 'hallo';
> $prompt['en-GB'][1] = 'hello';
> $prompt['es-ES'][1] = 'ola';
>
> Or vice versa:
>
> $prompt[1]['de-DE'] = 'hallo';
> $prompt[1]['en-GB'] = 'hello';
> $prompt[1]['es-ES'] = 'ola';
>
> Other syntax:
>
> $prompt[1] = array(
> 'de-DE' => 'hallo',
> 'en-GB' => 'hello',
> 'es-ES' => 'ola'
> );
>
> In my scripts the current page language is stored in a variable $lang
> for example, which can then also be used for the 'html' element:
>
> <html lang="<?php print $lang?>">
>
> Just an idea.
>
> I also recommend to have a look at the gettext extension, which can make
> localization and i18n much easier:
>
> http://www.php.net/manual/en/ref.gettext.php
>
> Micha
Without that gettext addon, how can I parse the language from a page to
determine which prompts to use?
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Michael Fesser" <netizen@gmx.de> wrote in message
news:lu8k42t9mdo9fgrf6n036ics888poeu1jr@4ax.com...
> .oO(Murray *ACE*)
>
>>How can I do an array assignment like this -
>>
>>$variable[1,1]='foo';
>
> $variable[1][1] = 'foo';
>
>>I want to have multiple sets of prompts, allowing multi-language pages,
>>e.g.,
>>
>>$prompt[1,1] = 'hello';
>>$prompt[2,1]='ola';
>
> For such things I use language codes instead of just numbers:
>
> $prompt['de-DE'][1] = 'hallo';
> $prompt['en-GB'][1] = 'hello';
> $prompt['es-ES'][1] = 'ola';
>
> Or vice versa:
>
> $prompt[1]['de-DE'] = 'hallo';
> $prompt[1]['en-GB'] = 'hello';
> $prompt[1]['es-ES'] = 'ola';
>
> Other syntax:
>
> $prompt[1] = array(
> 'de-DE' => 'hallo',
> 'en-GB' => 'hello',
> 'es-ES' => 'ola'
> );
>
> In my scripts the current page language is stored in a variable $lang
> for example, which can then also be used for the 'html' element:
>
> <html lang="<?php print $lang?>">
>
> Just an idea.
>
> I also recommend to have a look at the gettext extension, which can make
> localization and i18n much easier:
>
> http://www.php.net/manual/en/ref.gettext.php
>
> Micha
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

