I have a string which I have exploded, it starts like this,
|Crime|Drama|Mystery|Suspense|Thriller|
I would like to remove the first | and the last | after exploding so that the exploded text can look like this
Crime,Drama,Mystery,Suspense,Thriller
is this possible to do?
here is my code so far.
<?php $explodegen = explode("|", $val->Genre); ?>
<?php
foreach($explodegen as $exploding){
echo "".$exploding.",";
}
?>