Dynamic Title from PHP

Hi

I am new to PHP and struggling with the Dynamic Title for the webpage.

this is the webpage as an example:

site.com/page.php?lang=php&site=comparison.i-mobilephones.co.uk&options=&hs=onesilver

As you can see the page is about HTC One Silver Mobile Phone Deals.

Currently my webpage title for this phone is: “onesilver Cheap Mobile Phone Deals with Free Gift.”

The php code I am using to get the title is:

<title><?php echo $_GET[“hs”];?> Cheap Mobile Phone Deals with Free Gift.</title>

where “hs” = model number of the mobile phone.

what I want is the full model name e.g. “HTC One Silver” in the title, not “onesilver”

I also have a php file on the server called: “model.php” in this I have

<?php
$model = array(onesilver => ‘HTC One silver’, ot1030 => ‘Alcatel OT 1030’);
?>

Can anyone help please?

Thanks

Something like this, maybe?


$theModel=trim($_GET['hs']);
$titleModel='';


$models = array(onesilver => 'HTC One silver', ot1030 => 'Alcatel OT 1030'); 

if(array_key_exists($theModel, $models)){
     $titleModel=$models[$theModel];
}

echo $titleModel;


Thanks Force Flow.
It works perfectly fine…

You are a STAR!