06e1_ArraysReview

Basic Indexed Array - starts at Zero

aarvark
booby
criter
dear

Basic Indexed Array - Indexed at One - becomes 'Associative' Array

aardvaark
cat

Using Strings as Keys

--for some reason, on my machine it doesn't like using strings, and I don't see why.

The error is:

"Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /Applications/MAMP/htdocs/UCLAEXT-AdvWebDBMS-ResBund/Scoble-Nate-com/ScobleNate_web2/s06-sessionName/06e2_ArraysReview.php on line 30"

Line 30 being: echo "$myArray['one'] [br /](i can't use the f'in triangle brackets of course)";

Trying this again - it likes integers as keys just fine, but not the Strings.

aardvaark
bear
cat

OK, copying Mitch's code exactly:

Still getting that f'in error:

"Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /Applications/MAMP/htdocs/UCLAEXT-AdvWebDBMS-ResBund/Scoble-Nate-com/ScobleNate_web2/s06-sessionName/06e2_ArraysReview.php on line 63"

(line 63 being: echo"$myFriend['firstName'] plus the break thing that can't be put here;)

Frank
Novakowski
frank@nova.com

Frank
Novakowski
frank@nova.com

one more time...I'm not cheating & looking up! Wish I knew how such keys can reference more than ONE item here.

one
doo
twee
corps

one more time.

primero
segundo
tercero
cuatero?