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)
?>
ereg_replace()
Basically what i need to do is $title = "This Suck's"$striped = ereg_replace("[^A-Za-z0-9]", " ", $title ); However, I only want it to strip the " ' "
Big Problem!! Please help
Hi Guys,Im making a website for a friend have encountered a really annoying problem. When every i run the script below i get this error: "Parse error: syntax error, unexpected '}' in
split string
Hi all i have some names (imploded by comma):Code: toronto,paris,madridNow, i would obtain this result:Code: 'toronto','paris','madrid'How can i do? thanks
registration form
first time posting. did some searches but didnt find exactly what i am looking for. dont flame cause i am posting in the wrong area. I am starting from scratch with a new registration form for a
Credit card verification
I have a client who wants to process credit card transactions from his web site rather than the going through something like paypal. I've never done that before...what is my first step? I really dont
Consuming third party Payment Gateway API from Procedure.
Hi All,
eregi to preg
Im converting my regex for php 5.3 and I am stuck on the followingCode: [Select]if((eregi("<[^>]script*\"?[^>]*>", $secvalue)) ||
limitations on array_unique()
Does any one know what/how imitations are applied to array_unique? I have an issue where no matter how big (as in over this limit) the array is array_unique always returns an array with 32768
question about header() security
is is safe to just use the header() function to redirect someone if they are, say, not logged in? or should i always put a die() function underneath the header() function?
j1inmis Ouput layout changes
Hi,