Dave Goodchild wrote:
This may clarify - in php, integer and associate arrays are created
arbitrarily, ie keys can be numbers or strings. So, either create an array
like this:
array('1' => 'first element',
'2' => 'second element');
if I'm not mistaken the above example will result in an
On 5/4/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
Will this also work with an associative array? If this is what he is
talking about, I tried it and it does not work
I put this together though and it works, not sure if it is the *best*
way though...
'#ff','black'=>'#00','blue'=>
On Thu, May 4, 2006 9:09 am, John Wells wrote:
> On 5/4/06, Ford, Mike <[EMAIL PROTECTED]> wrote:
>> They're not even that. They're pure associative arrays, or maps --
>> it's just that integer keys are treated somewhat specially so that
>> an array with *only* integer keys will look like a traditi
On Thu, May 4, 2006 7:24 am, Jonas Rosling wrote:
> Is there any way to call for an element value in an array by the
> position?
> Like position 2 in the array and not the key name.
You DEFINITELY need to re-read the Array section of the manual.
Because you either didn't read it, or didn't unders
On 5/4/06, Ford, Mike <[EMAIL PROTECTED]> wrote:
They're not even that. They're pure associative arrays, or maps -- it's just
that integer keys are treated somewhat specially so that an array with *only*
integer keys will look like a traditional array.
True true, thanks for making it crystal
On 04 May 2006 13:52, John Wells wrote:
> On 5/4/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
> > Will this also work with an associative array? If this is what he
> > is talking about, I tried it and it does not work
> >
>
> I think you're correct. This is because PHP arrays are a "mash-u
[snip]
> $colors =
> array('white'=>'#ff','black'=>'#00','blue'=>'#ff');
> foreach($colors AS $key => $value){
> echo $value . "\n";
> }
>
But I don't get anything out of this code. Why? Doesn't echo anything?
[/snip]
Seriously? Works fine here.
--
PHP General Mailing List (http://w
[snip]
Lasso can do the following, can PHP?
Size;
Output: '' + $Colors->(Get: Loop_Count),-EncodeNone;
/Loop;
?>
This outputs;
ff
00ff00
ff
I'm new at PHP but not Lasso that's why I'm for you asking odd
questions.
[/snip]
1. Always respond to the list as a single use
[snip]
Seem like your missunderstanding me. I'm not using an orignal array. I'm
using an "map-array".
$array = ('element' = 'value');
[/snip]
It is called an associative array, a value is associated with a key.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.p
[snip]
Of course getting an indexed value into an associative array seems a bit
odd to me... maybe Jonas could shed some light on why he would go this
route...
[/snip]
Exactly
[snip]
To get a value from position 2 in an array you use $arrayName[1] (all
array elements start numbering at 0,
On 5/4/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
Will this also work with an associative array? If this is what he is
talking about, I tried it and it does not work
I think you're correct. This is because PHP arrays are a "mash-up"
(as Jochem put it) of numerical indexes/hashtables/as
This may clarify - in php, integer and associate arrays are created
arbitrarily, ie keys can be numbers or strings. So, either create an array
like this:
array('1' => 'first element',
'2' => 'second element');
and call by the key!
On 04/05/06, Jonas Rosling <[EMAIL PROTECTED]> wrote:
I
Nope... dead air.
Of course getting an indexed value into an associative array seems a bit
odd to me... maybe Jonas could shed some light on why he would go this
route...
Jay Blanchard wrote:
[snip]
I get nothing
do you get something different?
[/snip]
Not even 'array'?
--
PHP
Nothing.
// Jonas
Den 06-05-04 14.40, skrev "Jay Blanchard" <[EMAIL PROTECTED]>:
> [snip]
> $colors =
> array('white'=>'#ff','black'=>'#00','blue'=>'#ff');
> [/snip]
>
> What happens when you echo $colors[1]?
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, vi
[snip]
I get nothing
do you get something different?
[/snip]
Not even 'array'?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I get nothing
do you get something different?
Jay Blanchard wrote:
[snip]
$colors =
array('white'=>'#ff','black'=>'#00','blue'=>'#ff');
[/snip]
What happens when you echo $colors[1]?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.ph
[snip]
$colors =
array('white'=>'#ff','black'=>'#00','blue'=>'#ff');
[/snip]
What happens when you echo $colors[1]?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Seem like your missunderstanding me. I'm not using an orignal array. I'm
using an "map-array".
$array = ('element' = 'value');
// Jonas
Den 06-05-04 14.29, skrev "Jay Blanchard" <[EMAIL PROTECTED]>:
> [snip]
> Is there any way to call for an element value in an array by the
> position?
> Like
Will this also work with an associative array? If this is what he is
talking about, I tried it and it does not work
I put this together though and it works, not sure if it is the *best*
way though...
$colors =
array('white'=>'#ff','black'=>'#00','blue'=>'#ff');
[snip]
Is there any way to call for an element value in an array by the
position?
Like position 2 in the array and not the key name.
[/snip]
I hate to say this, but you really need to RTFM http://www.php.net/array
To get a value from position 2 in an array you use $arrayName[1] (all
array element
Is there any way to call for an element value in an array by the position?
Like position 2 in the array and not the key name.
// Jonas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
21 matches
Mail list logo