Jump to content

Different variable for array


erme

Recommended Posts

Hi,

 

I am basically trying to apply a different amount to $defineMe for certain numbers of an array .. in this case it's array numbers 11 - 16

 

<?php

if ($defineNumber > 11 and $defineNumber < 16) {
	$defineMe = 35.00;
} else {
	$defineMe = 50.00;
}

$defineNumber[01] = array('name'=>'Product 1');
$defineNumber[02] = array('name'=>'Product 2');
$defineNumber[03] = array('name'=>'Product 3');
$defineNumber[04] = array('name'=>'Product 4');
$defineNumber[05] = array('name'=>'Product 5');
$defineNumber[06] = array('name'=>'Product 6');

$defineNumber[11] = array('name'=>'Product 11');
$defineNumber[12] = array('name'=>'Product 12');
$defineNumber[13] = array('name'=>'Product 13');
$defineNumber[14] = array('name'=>'Product 14');
$defineNumber[15] = array('name'=>'Product 15');
$defineNumber[16] = array('name'=>'Product 16');
  
?>

Link to comment
https://forums.phpfreaks.com/topic/260181-different-variable-for-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.