You can use the PHP string function implode()
Like,
<?php
$sports=$_POST['sports'];;
$festival=$_POST['festival'];
$food=$_POST['food'];
$array=[$sports,$festival,$food];
$string=implode('|',$array);
echo $string;
?>
If, for example,
$sports='football';
$festival='janmastami';
$food='biriyani';
Then output would be:
football|janmastami|biriyani
For more details on PHP implode() function refer to w3schools