943,635 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 739
  • PHP RSS
Aug 18th, 2008
0

Newbie need Help with php code!!

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


?>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Tootlol is offline Offline
21 posts
since Aug 2008
Aug 18th, 2008
0

Re: Newbie need Help with php code!!

do a find and replace in your script for the following:
replace ‘ with '
replace ’ with '
Reputation Points: 358
Solved Threads: 89
Posting Shark
R0bb0b is offline Offline
986 posts
since Jun 2008
Aug 18th, 2008
0

Re: Newbie need Help with php code!!

Click to Expand / Collapse  Quote originally posted by R0bb0b ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Tootlol is offline Offline
21 posts
since Aug 2008
Aug 18th, 2008
0

Re: Newbie need Help with php code!!

Click to Expand / Collapse  Quote originally posted by Tootlol ...
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.
Reputation Points: 358
Solved Threads: 89
Posting Shark
R0bb0b is offline Offline
986 posts
since Jun 2008
Aug 19th, 2008
1

Re: Newbie need Help with php code!!

Click to Expand / Collapse  Quote originally posted by R0bb0b ...
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.
Reputation Points: 21
Solved Threads: 11
Junior Poster
MVied is offline Offline
111 posts
since Aug 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: problem in displaying data from mysql table..
Next Thread in PHP Forum Timeline: PHP wont display from MySql db





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC