parse error


Posted on 16th Feb 2014 07:03 pm by admin

Parse error: syntax error, unexpected '[', expecting ')' in /Users/admin/Sites/phptest/array.php on line 5

Code: <?php

Did you know?Explore Trending and Topic pages for more stories like this.
function shippingPrice($zone,$weight){
$ground = array(2 => array (
array(['lower'] => 0,['higher'] => 70,['av'] => 0.147,['base'] => 4.85);
array(['lower'] => 70,['higher'] => 100,['av'] => 0.710,['base'] => 14.82);
array(['lower'] => 100,['higher'] => 150,['av'] => 0.544,['base'] => 38.20);
)
)

foreach ($ground[$zone] as $row) {
if($row['lower'] <= $weight and $row['higher'] => $weight){

$price = (($weight - $row['base'])*$row['av']+$row['base'])
break;
}
echo shippingPrice(2,62)
?>
No comments posted yet

Your Answer:

Login to answer
298 Like 14 Dislike
Previous forums Next forums
Other forums

Redirect not working after making a POST/GET
Hi Everyone,

I am a novice in PHP. Here I have 2 pages, one page with a textbox and button an

PHP Captcha Error help - replace the "die" command
Hi All,

I am after a bit of help with a Captcha spam protection box.

The site gave me

ORA-01655: unable to extend cluster SYS.C_FILE#_BLOCK# by 128
Hi all,

Oracle 10g. Linux.

I'm facing the below error while trying to import a dumpfil

word wrap in emails help needed
Hello, I understand how wordwrap works in php and have used it well before. However when I used wor

Buggy registration system
Hey, I just started scripting in PHP, and I ran into a few problems.
Code: <?php
includ

Problem with HTML form
Hello,

I made a HTML form with some fields and check box.
Everything works fine except whe

PHP loop
Okay so I have several "articles" stored in a mysql database and am attempting to echo tho

Save data in input fields when they press "BACK BUTTON"
Hi, this is html form: And let's say they get a error "Please enter ur title must be more then

Need help making login verification cleaner...
I use the below to verify user login. I first check the cookie for the id, ip and a unique id. If it

selection tool on raster image
Hi!
I have to implement in my app a selection tool which lets users to select region of any shape

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash