The following statement creates an array with exactly one string in it, which is comprised of the values of two (apparently) undefined variables separated with a comma:
$models = array("$model0, $model1");
The end result is the same as if you had done this:
$models = array(", ");
Now you're imploding it using a comma as the separator, which doesn't do anything since there's only one element in the array (a string with a comma and a space).
Assuming $model0
and $model1
are defined (which is a problem you'll need to look into first), you can get your desired result either by:
- directly using
$modelfinal = "$model0, $model1"
, - or by using
$models = array($model0, $model1);
followed by the implode.