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

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

Best way to read this text file.
Hi.I am planning to make a small application in C# to convert the players from Football manager 2010

Changing files over
Just thought I'd start with the new forums looking really nice .

Ok basically I've made this

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

2 decima places & How to reload my page
Hello There,

How do i put full-stop (.) after second figure from behind? ie if i have 123456

Pulling out some result data from MYSQL
Hey Guys,

I've built a PHP page that has a for just imagine something like registration form

problems with contact forms that are only protected against SQL injections
What could be a potential problem with contact forms that are only protected against SQL injections

php mysql query from input textbox
Hi,

I have a text box, in that i have given the mysql query. I can able to get the query in v

Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data

Problem with PHP code- simple contact form
Hi Folks,
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a co

pass form variables straight to email, no database required?
hello all,

im working on this form...

http://www.adobedayevents.com/project_request/pr

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