I've got a simple array working based off the url ie www.example.com/apple/ it places in the apple text where I need it - but I also need an option of pasting in a separate fixed piece of text based off the brand.
IE so I can draw it with $brand_to_use to place in "apple" for example and $brandurl_to_use to draw in "apple.co.uk" where I need it but I'm not sure how to add this to the array based off the original brand.
Thanks
$recognised_brands = array(
"apple",
"orange",
"pear",
// etc
);
$default_brand = $recognised_brands[0]; // defaults brand to apple
$brand_to_use = isset($_GET['brand']) && in_array($_GET['brand'], $recognised_brands)
? $_GET['brand']
: $default_brand;
Pseudo code update example:
recognised brands =
apple
orange
pear
default brand = recognised brand 0
recognised brandurl =
apple = apple.co.uk
orange = orange.net
pear = pear.com
the brandurl is found from the recognised brands so that in the page content I can reference
brand which will show the text apple at certain places +
brandurl will show the correct brand url related to the brand ie apple.co.uk