0

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 />’;
}


?>

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by MVied
0

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

0

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 :(

0

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.

1

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. ;)

Votes + Comments
indeed
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.