Click here to Skip to main content
15,789,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
prints this:
Array ( ['note'] => sample1 ['value'] => 4 ) 
echo $item['value'];
echo $item['note'];
prints nothing!

Which is what the echo's using the keys should have printed.
I can't figure this out. What am I missing?

What I have tried:

foreach($item as $i) {
   echo $i ;
prints as the above echo statements should have:
Updated 4-Jul-17 16:59pm
Bryian Tan 4-Jul-17 13:49pm    
Interesting, everything seem checkout. What is the file extension? .php?

1 solution

I figured it out. It seems the quote marks around the array keys were causing an issue. This is a $_POST array so I changed my html form to eliminate the quotes. That got it working.

I was using an example from someone graciously provided me. Finally reached him and he confirmed his "typo" mistake.

Thanks for any comments.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900