Hi, recently I just started learning php as a complete beginner, and I wrote some codes that wasn't able to show up on my browser. Please check to see if there is anything wrong with it. This is the exactly what I used.

<?php

$prices= array( ‘Tires’=>100, ‘Oil’=>10, ‘Spark Plugs’=>4 );


foreach ($prices as $key => $value)
echo $key.’=>’.$value.’<br />’;

while( $element = each( $prices ) )
{
echo $element[ ‘key’ ];
echo ‘ - ‘;
echo $element[ ‘value’ ];
echo ‘<br />’;
}


?>

do a find and replace in your script for the following:
replace ‘ with '
replace ’ with '

do a find and replace in your script for the following:
replace ‘ with '
replace ’ with '

wow thank you very much!! I didn't notice that :(

Hi, recently I just started learning php as a complete beginner

after you go through enough wild goose chases, you will learn to look for the stupidest stuff first.

after you go through enough wild goose chases, you will learn to look for the stupidest stuff first.

We all still miss a semicolon now and then. ;)

Comments
indeed
This question has already been answered. Start a new discussion instead.