| | |
Newbie need Help with php code!!
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
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 />’;
}
?>
<?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 '
replace ‘ with '
replace ’ with '
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
![]() |
Similar Threads
- Apache (Linux Servers and Apache)
- Newbie php question. how to create a mailing list? (MySQL)
- CAn anyone provide me a very simple code for shopping cart? (PHP)
- Newbie Question - How to generate a link (PHP)
- http form -> php -> mysql snafu (PHP)
- Newbie to PHP question (PHP)
- PHP newbie... (PHP)
- mod_rewrite newbie needs a little help (Linux Servers and Apache)
- PHP newbie, project feasibility (PHP)
Other Threads in the PHP Forum
- Previous Thread: problem in displaying data from mysql table..
- Next Thread: PHP wont display from MySql db
Views: 572 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update updates upload url validation validator variable video web xml youtube





