I think of a syntax like:
$suffix1 = ($a === 1) ? 'this is one.' : 'this is:'
foreach ($keywords as $keyword) {
' and '
.$keyword
};
what should be like in case of $a === 1 output: this is one.
in case of not $a === 1 output: this is: one and two and three…
$keywords
comes from a input type text and will be splitted by:
$sepkeywords = preg_split('/[\s]+/', $keywords);
so if there is someone who could tell me how to get this i really would appreciate.
Are you looking for implode function?